program probe;

{$APPTYPE CONSOLE}

uses
  SysUtils;
label 1,2;
  var
 p:array[1..10000] of real;
 n,m,k,i:integer;
 fin,fout:textfile;
function orta(a,b:integer):real;
var s:real;
 l:integer;
begin
 s:=0;
 for l:=a to b do
  s:=s+p[l];
 orta:=s/(b-a+1);
end;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  assignfile(fin,'easy.in');
  assignfile(fout,'easy.out');
  reset(fin);rewrite(fout);
  readln(fin,m,n,k);
  for i:=1 to k do
   readln(fin,p[i]);
  i:=0;
  for i:=n to k do
   begin
    if orta(i-m,i)>orta(i-n,i) then
     if (i=n) or (orta(i-m-1,i-1)>orta(i-n-1,i-1)) then begin
      writeln(fout,'BUY ON DAY ',i);goto 1;
     end;
   end;
1:for i:=n to k do
   begin
    if orta(i-m,i)<orta(i-n,i) then
     if (i=n) or (orta(i-m-1,i-1)<orta(i-n-1,i-1)) then begin
      writeln(fout,'SELL ON DAY ',i-2);goto 2;
     end;
   end;
2:closefile(fin);closefile(fout);
end.
