#include<stdio.h>
#define MAX 10000
float p[MAX],pn[MAX],pm[MAX],sn,sm,a1,a2;
int n,m,i,k,j,f;
int main()
{freopen("easy.in","r",stdin);
freopen("easy.out","w",stdout);
scanf("%d %d %d",&m,&n,&k);
for (i=0;i<k;i++) scanf("%f",&p[i]);

sm=0; a1=p[n-m];
for (i=n-m;i<n;i++) sm+=p[i]; 
pm[n]=sm/m;

a2=p[0]; sn=0;
for (i=0;i<n;i++)
sn+=p[i]; 
pn[n]=sn/n;
i=n;

if (pm[i]>pn[i]) 
{printf("BUY ON DAY %d\n",i); f=1;}
if (pm[i]<pn[i])  
{printf("SELL ON DAY %d",i); f=-1;}

i++;
while (i<k)
{
sm=sm-a1+p[i];
sn=sn-a2+p[i];
pm[i]=sm/m;
pn[i]=sn/n;
a1=p[i-m];
a2=p[i-n];

if ((pm[i]>pn[i]) && (f==-1)) {printf("BUY ON DAY %d\n",i); f=1;}
if ((pm[i]<pn[i]) && (f==1))  {printf("SELL ON DAY %d\n",i); f=-1;}
i++;}

fclose(stdin);
fclose(stdout);
return 0;}