program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a:array[1..10000] of double;
      sm,sn:double;
      day:array[0..10000] of boolean;
      m,n,k,i:integer;

function p(vk,vl:integer):double;
var s:double;
    ii:integer;
begin
 s:=0;
 if vl>=vk then begin
  for  ii:=0 to vk-1 do
   begin
    s:=s+a[vl-ii];
   end;
  s:=s/vk;
  p:=s;
 end
 else p:=0;
end;


begin
 assign(input,'easy.in');
 reset(input);
  read(m,n,k);
   for i:=1 to k do
    read(a[i]);
 close(input);

 assign(output,'easy.out');
 rewrite(output);
 day[0]:=true;
 for i:=1 to k do
  begin
   sm:=p(m,i);
   sn:=p(n,i);
   if sm>sn then day[i]:=true;
   if sm<sn then day[i]:=false;
   if (i=n) or ((day[i-1]=false)and(day[i]=true))then
    if (sm>sn) and (sm*sn>0) then
    writeln('BUY ON DAY ',i);
   if (i=n) or ((day[i-1]=true)and(day[i]=false))then
    if (sm<sn) and (sm*sn>0) then
    writeln('SELL ON DAY ',i);
  end;
 close(output);
end.
