program Project1;

{$APPTYPE CONSOLE}

var m,n,k,i,j,cnt,buy,sell:integer;
    p:array[1..10000] of real;
    pm,pn,sum:real;
    flag1,flag2:boolean;
begin
  assign(input,'easy.in');
  assign(output,'easy.out');
  reset(input);
  rewrite(output);
  readln(m,n,k);
  for i:=1 to k do begin
     readln(p[i]);
  end;
  flag1:=false;
  flag2:=false;
  for i:=n to k do begin
     sum:=0;
     cnt:=0;
     for j:=i-m+1 to i do begin
        sum:=sum+p[j];
        inc(cnt);
     end;
     pm:=sum/cnt;
     sum:=0;
     cnt:=0;
     for j:=i-n+1 to i do begin
        sum:=sum+p[j];
        inc(cnt);
     end;
     pn:=sum/cnt;
     if (not flag1)and (pm>pn) then  begin
        buy:=i;
        flag1:=true;
     end;
     if (not flag2) and (pm<pn) then begin
        sell:=i;
        flag2:=true;
     end;
  end;
  writeln('BUY ON DAY ',buy);
  writeln('SELL ON DAY ',sell);  
  close(input);
  close(output);
end.
