program Project1;
 {$APPTYPE CONSOLE}

 Procedure Load;
 Var m,n,k,i : integer;
     buy   : boolean;
     curn,curm,temp  : real;
     inp : array[1..10000] of real;
 Begin
  assign(input,'easy.in');
  reset(input);
  assign(output,'easy.out');
  rewrite(output);
  readln(m,n,k);
  curn:=0;
  curm:=0;
  For i:=1 to N do
  Begin
   readln(temp);
   inp[i]:=temp;
   curn:=curn+temp;
   If(i>n-m)Then
    curm:=curm+temp;
  End;
  If(curn/n<curm/m)Then
   buy:=true
  Else
   buy:=false;
  If buy Then
   writeln('BUY ON DAY ',N)
  Else
   writeln('SELL ON DAY ',n);
  For i:=n+1 to k do
  Begin
   readln(inp[i]);
   curn:=curn-inp[i-n];
   curm:=curm-inp[i-m];
   curn:=curn+inp[i];
   curm:=curm+inp[i];
   If(curn/n<curm/m)and(not buy)Then
   Begin
    buy:=true;
    writeln('BUY ON DAY ',i)
   End
   Else
    If(curn/n>curm/m)and(buy)Then
    Begin
     buy:=false;
     writeln('SELL ON DAY ',i);
    End;
  End;
  close(output);
  close(input);               
 End;
{-------------------------------------------------------------------}
 BEGIN
  Load;
 END.
