#include <iostream>

using namespace std;

#define N 10001

double Pn(int );
double Pm(int );

int n;
int m;
int k;


float *array = new float[N];

int main()
{
	FILE * fin = fopen("easy.in","r");
	FILE * fout = fopen("easy.out","w");

	fscanf(fin,"%i",&m);
	fscanf(fin,"%i",&n);
	fscanf(fin,"%i",&k);
	int  control=0;
	double one=1;
	double two=2;
	for(int i=0;i<k;i++)
	{
		fscanf(fin,"%f",&array[i]);
	}

	int status=1;
	for(i=n;i<k;i++)
	{
		one = Pm(i);
		two = Pn(i);
		if(one > two)
		{ 
			if(status == 1)
			{	
				status=999;
				fprintf(fout,"%s","BUY ON DAY ");
				fprintf(fout,"%i\n",i);
				control=1;
				continue;
			}
					
			if(control==0)
			{
				fprintf(fout,"%s","BUY ON DAY ");
				fprintf(fout,"%i\n",i);
				control=1;
			}
			else
				continue;
		}
		else
		{
			if(status == 1)
			{
				status=999;
				fprintf(fout,"%s","SELL ON DAY ");
				fprintf(fout,"%i\n",i);
				control=0;
				continue;
			}
			
			if(control==1)
			{
				fprintf(fout,"%s","SELL ON DAY ");
				fprintf(fout,"%i\n",i);
				control=0;
			}
			else
				continue;
		}

	}
	return 0;
}

double Pm(int number)
{
	int j=0;
	float total=0;
	int pointer=number-1;
	int start=pointer-m+1;
	double average=0;
	for(j=start;j<=pointer;j++)
	{
		total += array[j];
	}
	average = total/m;	
	return average;
}

double Pn(int number)
{
	int j=0;
	float total=0;
	int pointer=number-1;
	int start=pointer-n+1;
	double average=0;
	for(j=start;j<=pointer;j++)
	{
		total += array[j];
	}
	average = total/n;	
	return average;
}