#include<fstream.h>
ifstream fin("easy.in");
ofstream fout("easy.out");
int main()
{
	const int N=11000;
	int m,n,k,i,day;
	double price[N],pm,pn,ppn,ppm;
	fin>>m>>n>>k;
	for(day=1;day<=k;day++)
		fin>>price[day];
	for(day=n;day<=k;day++)
	{		
		pn=pm=0;
		for(i=day;i>day-n;i--)
		{
			pn+=price[i];
			if(i>day-m)
				pm+=price[i];
		}
		pm=pm/m;
		pn=pn/n;
		if(day==n)
			if(pm>pn)
				fout<<"BUY ON DAY "<<day<<endl;
			else
				fout<<"SELL ON DAY "<<day<<endl;
		else
		{
			ppn=ppm=0;
			for(i=day-1;i>day-1-n;i--)
			{
				ppn+=price[i];
				if(i>day-1-m)
					ppm+=price[i];
			}
			ppn=ppn/n;
			ppm=ppm/m;
			if(ppm>ppn && pm<pn)
				fout<<"SELL ON DAY "<<day<<endl;		
			else
				if(ppm<ppn && pm>pn)
					fout<<"BUY ON DAY "<<day<<endl;
		}
	}
return 0;
}