#include <stdio.h>
//#include <stdlib.h>

int		M, N, K;
int		More;
float	P[10001];
float	Pn;
float	Pm;

void FileRead()
{
	int i;
	FILE *input = fopen("easy.in", "r");
	fscanf(input, "%d %d %d", &M, &N, &K);
	for(i=1; i<K+1; i++)
	{
		fscanf(input, "%f", &P[i]);
	}
	fclose(input);
}

void Init()
{
	int i;
	Pn = 0; Pm = 0;

	for(i=1; i<N+1; i++) Pn += P[i];
	Pn /= N;

	for(i=N-M+1; i<N+1; i++) Pm += P[i];
	Pm /= M;
}

void Count(int n)
{
	Pn += P[n]/N;
	Pn -= P[n-N]/N;
	Pm += P[n]/M;
	Pm -= P[n-M]/M;
}

void Solution()
{
	int i;
	FILE *output = fopen("easy.out", "w");
	
	if( Pn > Pm )
	{
		fprintf(output, "SELL ON DAY %i\n", N);
		More = 1;
	}
	else
	{
		fprintf(output, "BUY ON DAY %i\n", N);
		More = 0;
	}

	for(i=N+1; i<=K; i++)
	{
		Count(i);
		if( (More == 1) && (Pn < Pm) )
		{
			fprintf(output, "BUY ON DAY %i\n", i);
			More = 0;
		}
		if( (More == 0) && (Pn > Pm) )
		{
			fprintf(output, "SELL ON DAY %i\n", i);
			More = 1;
		}
	}
	
	fclose(output);
}

int main()
{
	FileRead();
	Init();
	Solution();
	return 0;
}