program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  f,f1:text;
  m,n,k:integer;
  flag,i,j:integer;
  avgm,avgn,sum:real;
  mas:array[1..10000] of real;
begin
  assign(f,'easy.in');
  reset(f);
  assign(f1,'easy.out');
  rewrite(f1);
  read(f,m,n,k);

  for i:=1 to k do readln(f,mas[i]);

  for i:=n to k do
  begin
  sum:=0;
  for j:=i-n+1 to i do sum:=sum+mas[j];
  avgn:=sum/n;
  sum:=0;
  for j:=i-m+1 to i do sum:=sum+mas[j];
  avgm:=sum/m;
  if ((avgm>avgn) and (flag<>2)) then begin flag:=2; writeln(f1,'BUY ON DAY ',i); end;
  if ((avgn>avgm) and(flag<>1)) then begin flag:=1; writeln(f1,'SELL ON DAY ',i);end;
  end;
  close(f);
  close(f1);
end.
