var
 fin,fout:textfile;
 m,n,k,i,j:longint;
 map:array[1..11000] of extended;
 s1,s2,pm,pn:extended;
 bu,be:boolean;
begin
  assignfile(fin,'easy.in');
  assignfile(fout,'easy.out');
  reset(fin);
  rewrite(fout);
  readln(fin,m,n,k);
  for i:=1 to k do begin
   readln(fin,s1);
   map[i]:=s1;
  end;
  i:=n;
  bu:=true;
  be:=true;
  s1:=0;
  for j:=1 to n do s1:=s1+map[j];
  s2:=0;
  for j:=n-m+1 to n do s2:=s2+map[j];
  pm:=s2/m;
  pn:=s1/n;
  while i<=k do begin
   if pm>pn then begin
    if be then begin
     writeln(fout,'BUY ON DAY ',i);
    end;
    bu:=true;
    be:=false;
   end;
   if pm<pn then begin
    if bu then begin
     writeln(fout,'SELL ON DAY ',i);
    end;
    bu:=false;
    be:=true;
   end;
   i:=i+1;
   s1:=s1-map[i-n]+map[i];
   s2:=s2-map[i-m]+map[i];
   pm:=s2/m;
   pn:=s1/n;
  end;
  closefile(fin);
  closefile(fout);
end.