program eee;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var m,n,k : integer;
    i,j : integer;
    p : real;
    a : array [0..11000] of integer;
    an : array [0..11000] of integer;
    am : array [0..11000] of integer;

procedure init;
begin
  assign(input,'easy.in');
  reset(input);
  read(m,n,k);
  for i := 1 to k do begin
    read(p);
    a[i] := trunc(p*100);
  end;
  close(input);
  assign(output,'easy.out');
  rewrite(output);
end;

procedure solve;
 var s1, s2 : integer;
     cn : integer;
begin
  s1 := 0;
  s2 := 0;
  cn := 0;

  for i := 1 to k do begin
    s1 := s1 + a[i];
    s2 := s2 + a[i];

    if i > m then s1 := s1 - a[i-m];
    if i > n then s2 := s2 - a[i-n];

    if (i >=n) then begin
      inc(cn);
      am[cn] := s1 div m;
      an[cn] := s2 div n;
    end;

  end;

  if am[1] < an[1] then writeln('SELL ON DAY ', n);

  if am[1] > an[1] then writeln('BUY ON DAY ', n);

  for i := 2 to cn do begin
   if (am[i] > an[i]) and (am[i-1] < an[i-1]) then writeln('BUY ON DAY ', i + n - 1);
   if (am[i] < an[i]) and (am[i-1] > an[i-1]) then writeln('SELL ON DAY ', i + n - 1);
  end;

  close(output);
end;

procedure done;
begin

end;

begin
 init;
 solve;
 done;
end.
