#include <iostream.h>
#include <fstream.h>

main()
{double a[10000],b[10000],c[10000]; int p,q,i,j,m,n,k;

	
	ifstream in("easy.in",ios::in);
    ofstream out("easy.out",ios::out); 
in>>m>>n>>k;
for(i=0;i<k;i++)
in>>a[i];

for(i=n-1;i<k;i++)
{b[i]=0;
for(j=i;j>i-m;j--)
b[i]+=a[j];
b[i]=b[i]/m;

c[i]=0;
for(j=i;j>i-n;j--)
c[i]+=a[j];
c[i]=c[i]/n;
}
if(c[n-1]<b[n-1]) {q=1;out<<"BUY ON DAY "<<n<<'\n';} 
else {q=0;out<<"SELL ON DAY "<<n<<'\n';}
for(i=n;i<k;i++)
{
if(c[i]>b[i]) p=0; else p=1; 
if(p!=q) if(p==1){q=1;out<<"BUY ON DAY "<<i+1<<'\n';} else {q=0;out<<"SELL ON DAY "<<i+1<<'\n';}
}

return 0;
}