#include <fstream.h>

ifstream in( "easy.in" );
ofstream out( "easy.out" );

const int bufs = 101;

inline incb( int& i )
{
	++i;
	i %= bufs;
}

int main()
{
	double buf[bufs];
	double sumn = 0, summ = 0;

	int m, n, k, p, fn, fm, i;

	in >> m >> n >> k;

	fn = 0;
	fm = n - m;
	for ( p = 0; p<fm; ++p )
	{
		in >> buf[p];
		sumn += buf[p];
	}

	for ( ; p<n; ++p )
	{
		in >> buf[p];
		sumn += buf[p];
		summ += buf[p];
	}

	--p;
	bool isbear, oisbear;
	for ( i = n; i<=k; ++i )
		{
		isbear = (sumn / n)<(summ / m);
		if ((i==n) || (oisbear!=isbear))
		{
			if (isbear)
				out << "BUY ON DAY " << i << endl;
			else
				out << "SELL ON DAY " << i << endl;
			oisbear = isbear;
		}
		if (i<k)
		{
			sumn -= buf[fn];
			summ -= buf[fm];
			incb( fn ); incb( fm ); incb( p );
			in >> buf[p];
			sumn += buf[p];
			summ += buf[p];
		}
	}

	return 0;
}