#include <fstream>

using namespace std;


int main()
{
	ifstream in("easy.in");
	ofstream out("easy.out");
	int m, n, k;
	in >> m >> n >> k;
	double p[10005];
	int i, j;
	for(i = 0; i < k; i ++)
		in >> p[i];
	in.close();
	bool b = false;
	double pm, pn;
	int mas[10005];
	int y = 0;
	for(i = 0; i < k; i ++)
		mas[i] = 0;
	for(i = n - 1; i < k; i ++)
	{
		if(i == n - 1)
		{
			pm = 0;
			pn = 0;
			for(j = i; j >= i - n + 1; j --)
				pn += p[j];
			for(j = i; j >= i - m + 1; j --)
				pm += p[j];
		}
		else
		{
			pn += p[i];
			pm += p[i];
			pn -= p[i - n];
			pm -= p[i - m];
		}
		if(pm / m > pn / n)
		{
			if(i == n - 1 || y == 2)
			{
				mas[i] = 1;
				y = 1;
			}
		}
		if(pm / m < pn / n)
		{
			if(i == n - 1 || y == 1)
			{
				mas[i] = 2;
				y = 2;
			}
		}
	}
	for(i = n - 1; i < k; i ++)
	{
		if(mas[i] == 1)
			out << "BUY ON DAY " << i + 1 << endl;
		if(mas[i] == 2)
			out << "SELL ON DAY " << i + 1 << endl;
	}
	out.close();
	return 0;
}
