program easy;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
f,ff:textfile;
i,l,n,m,k:integer;
a:array[1..10000] of real;
p1,p2:real;
begin
assign(f,'easy.in');
reset(f);
assign(ff,'easy.out');
rewrite(ff);
readln(f,m,n,k);
for i:=1 to k do readln(f,a[i]);
for i:=n to k do
    begin
    p1:=0;
    for l:=i-m+1 to i do p1:=p1+a[l];
    p1:=p1/m;
    p2:=0;
    for l:=i-n+1 to i do p2:=p2+a[l];
    p2:=p2/n;
    if (p1>p2) and ((i=n) or (a[i-1]<a[i]))  then writeln(ff,'BUY ON DAY ',i);
    if (p1<p2) and ((i=n) or (a[i-1]>a[i])) then writeln(ff,'SELL ON DAY ',i);
    end;







closefile(f);
closefile(ff);
end.
