{$DEFINE DMI}
{$DEFINE DO0}
{$DEFINE DEBUG}
{$IFDEF DEBUG}
{$B-,I+,N+,O-,Q+,R+,S+}
{$ELSE}

{$B-,I-,N+,O+,Q-,R-,S-}
{$ENDIF}
{$APPTYPE CONSOLE}
Program OlympSol;
uses SysUtils;
const TaskName = 'easy';

 MaxN = 10004;
var i, j, k, l, m, n: Integer;
p:array[1..10000] of extended;
tend:array[1..10000] of integer;
bull, bear:extended;
BEGIN
 assign (input, TaskName + '.in'); reset (input);
 assign (output, TaskName + '.out'); rewrite (output);
{$IFDEF DMI} repeat {$ENDIF}
 read (m,n,k);
 for i:=1 to k do read(p[i]);
 bull:=0;
 bear:=0;
 for i:=1 to n do bear:=bear+p[i];
 for i:=n-m+1 to n do bull:=bull+p[i];
 if bull*n>bear*m then
   tend[n]:=1
 else
   tend[n]:=-1;
 i:=n;
 repeat
   if tend[i]>0 then begin
     if (i=n) or(tend[i-1]<0) then writeln('BUY ON DAY ',i);
   end;
   if tend[i]<0 then begin
     if (i=n) or(tend[i-1]>0) then writeln('SELL ON DAY ',i);
   end;
   inc(i);
   if i>k then break;
   bear:=bear+p[i]-p[i-n];
   bull:=bull+p[i]-p[i-m];
   if bull*n>bear*m then
     tend[i]:=1
   else
     tend[i]:=-1;
 until i>k;
  

{$IFDEF DMI} until seekeof; {$ENDIF}
END.
