#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <cassert>
//#include <vector>
#include <algorithm>

const int maxk = 10100;
double A [maxk], B [maxk];

int main ()
{
	freopen ("easy.in", "rt", stdin);
	freopen ("easy.out", "wt", stdout);

	memset (A, 0, sizeof (A));
	memset (B, 0, sizeof (B));
	
	int m, n, k, i, j;
	double Pm, Pn;

	scanf ("%d %d %d ", &m, &n, &k);
	for (i = 1; i <= k; i++)
	{
		scanf ("%lf ", &A [i]);
		B [i] = B [i-1] + A [i];
	}

	bool prev;
	for (i = n; i <= k; i++)
	{
		Pm = (B[i] - B[i-m]) / m;
		Pn = (B[i] - B[i-n]) / n;
		if (i == n || (Pn > Pm) != prev)
			printf ("%s ON DAY %d\n",
				(Pn > Pm ? "SELL" : "BUY"),
				i);
		prev = (Pn > Pm);
	}

	fclose (stdin);
	fclose (stdout);
	return 0;
}