#include <fstream>
#include <iostream>
#include <vector>

int m, n, k, s;
std::vector<double> p;
double pm, pn;
bool oldper = false;
bool newper = false;
int main()
{
	std::ifstream  in("easy.in");
	std::ofstream out("easy.out");
	in >>m >>n >>k;
	p.resize(k + 1);
	for (size_t i = 1 ; i <= k ; i++)
		in >>p[i];
	for (i = n ; i <= k ; i++) {
		
		pn = pm = 0.0;

		for (s = (i - m + 1) ; s <= i ; s++)
			pm += p[s];

		for (s = (i - n + 1) ; s <= i ; s++)
			pn += p[s];

		pm /= m;
		pn /= n;

		if (pm > pn) {
			newper = true;	
			if (i == n)
				out << "BUY ON DAY " << i << std::endl;
			else
				if(!oldper)
					out << "BUY ON DAY " << i << std::endl;
		}
		else {
			newper = false;
			if (i == n)
				out << "SELL ON DAY " << i << std::endl;
			else
				if(oldper)
					out << "SELL ON DAY " << i << std::endl;
		}
		oldper = newper;		
	}

	return 0;
}