#include <iostream>
#include <fstream>
#include <algorithm>

//std::istream* from = &std::cin;
//std::ostream* to = &std::cout;

std::ifstream* from = new std::ifstream("easy.in");
std::ofstream* to = new std::ofstream("easy.out");

const int MAX = 20000;

double Ks[MAX];
int k;

double avg(int n, int off)
{
	double res = 0;
	for(int i = n - off + 1; i <= n; i++)
		res += Ks[i];
	return res / static_cast<double>(off);
}

int main(void)
{

	int m, n;
	*from >> m >> n >> k;
	for(int i = 1; i <= k; i++)
		*from >> Ks[i];
	bool is_bullish = avg(n, m) > avg(n, n);
	if(avg(n, m) > avg(n, n))
		*to << "BUY ON DAY " << n << std::endl;
	else
		*to << "SELL ON DAY " << n << std::endl;
	for(i = n + 1; i <= k; i++)
	{
		double Pm = avg(i, m);
		double Pn = avg(i, n);
		double Pm1 = avg(i - 1, m);
		double Pn1 = avg(i - 1, n);
		if((Pm > Pn) && (Pm1 < Pn1))
			*to << "BUY ON DAY " << i << std::endl;
		else if((Pm < Pn) && (Pm1 > Pn1))
			*to << "SELL ON DAY " << i << std::endl;
	}
	delete from;
	delete to;
	return 0;
}