#include <fstream>
using namespace std;

int m, n, k;
double *prices;

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

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

	int i;

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

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

	int state = 0;

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

		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;
}