program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
a:array [0..10000] of longint;
a1:array [0..10000] of longint;
a2:array [0..10000] of longint;
s1,s,m,n,k,t,p:longint;
r:real;
f,f1:text;
st:string;
q:boolean;
begin
assignFile(f,'easy.in');
assignFile(f1,'easy.out');
reset(f);
rewrite(f1);
readln(f,m,n,k);
for t:=1 to k do begin
readln(f,r);
a[t]:=round(r*100);
end;
s:=0;
s1:=0;
for t:=1 to n-1 do s:=s+a[t];
a[0]:=0;
for t:=n to k do begin
s:=s+a[t]-a[t-n];
a1[t]:=s;
end;
for t:=1 to m-1 do s1:=s1+a[t];
for t:=m to k do begin
s1:=s1+a[t]-a[t-m];
a2[t]:=s1;
end;
if m*a1[n]<n*a2[n] then writeln(f1,'BUY ON DAY ',n);
if m*a1[n]>n*a2[n] then writeln(f1,'SHELL ON DAY ',n);
for t:=n+1 to k do begin
if (m*a1[t]<n*a2[t]) and (m*a1[t-1]>n*a2[t-1]) then writeln(f1,'BUY ON DAY ',t);
if (m*a1[t]>n*a2[t]) and (m*a1[t-1]<n*a2[t-1]) then writeln(f1,'SHELL ON DAY ',t);
end;

closeFile(f);
closeFile(f1);



  { TODO -oUser -cConsole Main : Insert code here }
end.
