#include <fstream.h>

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

	double mas[10000];

int main()
{
	double pm,pn; long n,m,k;

	in>>m>>n>>k;

	for (int i=0;i<k;i++)
		in>>mas[i];
	
	pn=0; pm=0;
	for (i=0;i<n;i++)
		pn+=mas[i];
	for  (i=n-m;i<n;i++)
		pm+=mas[i];

	bool x;

	if (pm*n>pn*m)
	{	out<<"BUY ON DAY "<<n<<endl;	x=false; }
	else
	{	out<<"SELL ON DAY "<<n<<endl; x=true; }

	for (i=n;i<k;i++)
	{

		pm+=mas[i]-mas[i-m];
		pn+=mas[i]-mas[i-n];

		
		if ((pm*n>pn*m) && (x))
		{	out<<"BUY ON DAY "<<i+1<<endl;	x=false; }
		
		if ((pm*n<pn*m) && (!x))
		{	out<<"SELL ON DAY "<<i+1<<endl; x=true; }
	}

	return 0;
}