#include <fstream.h>

#define SIZE 20000

int trunc ( int n )
{
	return ( n == SIZE ? 0 : n );
}

int main ()
{
	int i, j;

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

	int m, n, k;
	in >> m >> n >> k;

	double p[SIZE];
	for ( i = 1; i <= k; ++i )
	{
		in >> p[i];
	}


	
	int prev;
	i = n;

	double pm = 0.0, pn = 0.0;
	double ppm[SIZE], ppn[SIZE];
	int m_f = n-m+1, m_l = n, n_f = 1, n_l = n;

	for ( j = i-m+1; j <= i; ++j )
	{
		pm += p[j];
		ppm[j] = p[j];
	}
	for ( j = i-n+1; j <= i; ++j )
	{
		pn += p[j];
		ppn[j] = p[j];
	}

	pm /= m;
	pn /= n;

	if ( pm > pn )
	{
		out << "BUY ON DAY " << i << "\n";
		prev = 0;
	}
	else
	{
		out << "SELL ON DAY " << i << "\n";
		prev = 1;
	}

	for ( i = n+1; i <= k; ++i )
	{
		m_l = trunc ( m_l+1 );
		ppm[m_l] = p[i];
		pm = pm - ppm[m_f]/m + ppm[m_l]/m;
		m_f = trunc ( m_f+1 );

		n_l = trunc ( n_l+1 );
		ppn[n_l] = p[i];
		pn = pn - ppn[n_f]/n + ppn[n_l]/n;
		n_f = trunc ( n_f+1 );

		if ( pm > pn )
		{
			if ( i == n || prev == 1 )
			{
				out << "BUY ON DAY " << i << "\n";
			}
			prev = 0;
		}
		else
		{
			if ( i == n || prev == 0 )
			{
				out << "SELL ON DAY " << i << "\n";
			}
			prev = 1;
		}
	}

	return 0;
}
