#include <stdio.h>

FILE *f;

int m,n,k,i;
double a[10000], pm[10000], pn[10000];

int main()
{
	f = fopen("easy.in","rt");
	fscanf(f,"%d %d %d",&m,&n,&k);
	for(i=0; i<k; i++)
		fscanf(f,"%lf", &a[i]);
	fclose(f);

	double p;

	p = 0;
	for(i=0; i<=n-2; i++)
		p += a[i];

	for(i=n-1; i<k; i++)
	{
		p += a[i];
		pn[i] = p/n;
		p -= a[i-(n-1)];
	}


	p = 0;
	for(i=0; i<=m-2; i++)
		p += a[i];

	for(i=m-1; i<k; i++)
	{
		p += a[i];
		pm[i] = p/m;
		p -= a[i-(m-1)];
	}

	f = fopen("easy.out","wt");

/*	for(i=0; i<k; i++)
		fprintf(f,"%lf ",pn[i]);
	fprintf(f,"\n");
	for(i=0; i<k; i++)
		fprintf(f,"%lf ",pm[i]);
	fprintf(f,"\n");*/

	int q = 0, x;
// 1 - buy
// 2 - sell
	for(i=n-1; i<k; i++)
	{
		if (pm[i]>pn[i]) x = 1;  else  x = 2;
			
		if (q != x)
		{
			q = x;
			if (x == 1) 
				fprintf(f,"BUY ON DAY %d\n",i+1);
			else
				fprintf(f,"SELL ON DAY %d\n",i+1);
		}
	}
	fclose(f);

	return 0;
}
