#include <fstream>
using namespace std;

int m, n, k;
float *prices;

float average(int start, int end)
{
	if (start < 0)
		start = 0;
	float sum = 0.0;
	for (int i = start; i < end; ++i)
		sum += prices[i];
	return sum / (end - start);
}

int main()
{
	ifstream in("easy.in");
	ofstream out("easy.out");

	int i;

	in >> m >> n >> k;
	prices = new float[k];
	for (i = 0; i < k; ++i)
		in >> prices[i];

	float pm_prev = -1, pm;
	float pn_prev = -1, pn;

	int state = 0;

	for (i = n; i < k; ++i)
	{
		pm = average(i - m, i+1);
		pn = average(i - n, i+1);

		if (pm > pn && state != 1)
		{
			out << "BUY ON DAY " << i << "\n";
			state = 1;
		}
		if (pm < pn && state != -1)
		{
			out << "SELL ON DAY " << i << "\n";
				state = -1;
		}
	}

	in.close();
	out.close();
	return 0;
}