#include <fstream>
#include <vector>
using namespace std;
ifstream in("easy.in");
ofstream out("easy.out");
vector<float> base;
float Pm=0, Pn=0;
int m,n;
/*float P(int i)
{
	int k,z=0;
	float rez;
	Pm*=m;
	Pn*=n;
	if(i>=m)
		Pm-=base[i-m];
	if(i>=n)
		Pn-=base[i-n];
	Pm+=base[i];
	Pn+=base[i];

	Pm/
}*/
int main()
{
	int k,i;
	float j;
	bool bn=0;
	in >> m >> n >> k;
	for(i=n;i<k;i++)
	{
		in >> j;
		base.push_back(j);
	}
	for(i=0;i<m;i++)
		Pm+=base[i];
	Pn=Pm;
	for(i=m;i<n;i++)
	{
		Pn+=base[i];
		Pm+=base[i];
		Pm-=base[i-m];
	}
	if((Pn/n)>(Pm/m))
	{
		out << "SELL ON DAY "<< n << endl;
		bn=1;
	}
	if((Pn/n)<(Pm/m))
	{
		out << "BUY ON DAY "<< n << endl;
		bn=0;
	}
	for(i=n;i<k;i++)
	{
		Pn+=base[i];
		Pm+=base[i];
		Pm-=base[i-m];
		Pn-=base[i-n];
		if((Pn/n)>(Pm/m) && !bn)
		{
			out << "SELL ON DAY "<< i+1 << endl;
			bn=1;
		}
		if((Pn/n)<(Pm/m) && bn)
		{
			out << "BUY ON DAY "<< i+1 << endl;
			bn=0;
		}
	}
	return 0;
}