program z1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
  var i,j:integer;
      m,n,k,t:longint;
     s:real;
      p:array[1..10000]of real;
      pm,pn:array[1..10000]of real;
procedure init;
 begin
  assign(input,'easy.in');
  assign(output,'easy.out');
  reset(input);
  rewrite(output);
  readln(m,n,k);
  for i:=1to k do
  readln(p[i]);

 end;

procedure solve;
 begin
  for j:=n to k do
   begin
          //считаем среднее
    s:=0;
    for t :=0 to m-1 do
     s:=s+p[j-t];
    pm[j]:=s/m;
     s:=0;
    for t :=0 to n-1 do
     s:=s+p[j-t];
    pn[j]:=s/n;

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

 end;

procedure final;
 begin
  close(input);
  close(output);
 end;

begin
init;
solve;
final;
end.
