{$O-,R+,Q+}
var
 i,n,m,k:longint;
 a:array[1..10000] of extended;
 ns, ms: array[1..10000] of extended;
begin
 assign(input,'easy.in'); reset(input);
 assign(output,'easy.out'); rewrite(output);
 read(m,n,k);
 for i := 1 to k do read(a[i] );

 ns[n] := 0;
 for i := 1 to n do
   ns[n] := ns[n] + a[i];
 for i := n + 1 to k do begin
   ns[i] := ns[ i - 1] + a[i] - a[i - n];
 end;
 for i := n to k do
   ns[i] := ns[i] / n;

 ms[m] := 0;
 for i := 1 to m do
   ms[m] := ms[m] + a[i];
 for i := m + 1 to k do begin
   ms[i] := ms[ i - 1] + a[i] - a[i - m];
 end;
 for i := m to k do
   ms[i] := ms[i] / m;

 for i := n to k do begin
   if ms[i] > ns[i] then begin
     if ( i = n ) or ( ms[i-1] < ns[i-1] ) then
       writeln('BUY ON DAY ', i );
   end else begin
     if ( i = n ) or ( ms[i-1] > ns[i-1] ) then
       writeln('SELL ON DAY ', i );
   end;
 end;

end.