#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 = 10000;

double Ks[MAX];
int k;

double avg(int n, int off)
{
	double res = 0;
	for(int i = n - off; 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 = 0; i < k; i++)
		*from >> Ks[i];
	bool is_bullish = false;
	for(i = n; i < k; i++)
	{
		double Pm = avg(i, m);
		double Pn = avg(i, n);
		if((Pm > Pn) && !is_bullish)
			*to << "BUY ON DAY " << i << std::endl;
		else if((Pm < Pn) && is_bullish)
			*to << "SELL ON DAY " << i << std::endl;
		is_bullish = Pm > Pn;
	}
	delete from;
	delete to;
	return 0;
}