#include <cstdio>

const int K = 11000;
double price[K];
double pm[K], pn[K];
int main()
{
	FILE *inf = fopen("easy.in","rt");
	FILE *outf = fopen("easy.out","wt");
	int n,m,i,k;
	fscanf(inf,"%ld%ld%ld",&m,&n,&k);
	double spm = 0;
	double spn = 0;
	for(i=1;i<=k;i++)
	{
		double pr;
		fscanf(inf,"%lf",&pr);
		price[i] = pr;
		spm += pr;
		spn += pr;
		if(i>m)
			spm -= price[i-m];
		if(i>n)
			spn -= price[i-n];
		pm[i] = spm/m;
		pn[i] = spn/n;
	}
	for(i=n;i<=k;i++)
	{
		if(pm[i] > pn[i] 
			&& (i==n || pm[i-1] < pn[i-1]))
			fprintf(outf,"BUY ON DAY %ld\n",i);
		if(pm[i] < pn[i]
			&& (i==n || pm[i-1] > pn[i-1]))
			fprintf(outf,"SELL ON DAY %ld\n",i);
	}
	fclose(inf);
	fclose(outf);
	return 0;
}