#include	<stdio.h>

#define	MAXK	20000

int m, n, k;
double prices[MAXK];

double Avg(int start, int size)
{
	double sum = 0.0;
	for (int i = start; i < start + size; ++i)
		sum += prices[i];
	return sum / size;
}

int main(void)
{
	freopen("easy.in", "r", stdin);
	freopen("easy.out", "w", stdout);

	scanf("%d %d %d", &m, &n, &k);

	int i;
	for (i = 0; i < k; ++i)
		scanf("%lf", prices + i);

	double oldN = Avg(0, n);
	double oldM = Avg(n - m ,m);

	if (oldM > oldN)
		printf("BUY ON DAY %d\n", n);
	else
		printf("SELL ON DAY %d\n", n);

	for (i = n; i < k; ++i)
	{
		double N = Avg(i - n + 1, n);
		double M = Avg(i - m + 1, m);

		if ( (N < M) && (oldN > oldM) )
			printf("BUY ON DAY %d\n", i + 1);
		if ( (N > M) && (oldN < oldM) )
			printf("SELL ON DAY %d\n", i + 1);
		
		oldN = N;
		oldM = M;
	}

	return 0;
}