{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}

const
  cinfile = 'easy.in';
  coutfile = 'easy.out';
  nmax = 10010;
  eps = 1E-8;

type
  int = longint;
  real = extended;
  float = extended;

var
  n, k, m : int;
  ans : int;
  a : array[1..nmax] of float;

procedure outdata;
var
  i, j : int;
begin
end;

function f(ind, cnt : int) : float;
var
  i : int;
  res : float;

begin
  res := 0;
  for i := ind downto ind - cnt + 1 do res := res + a[i];
  f := res/cnt;
end;

procedure outNOW(b : boolean; ind : int);
begin
  if b then writeln('BUY ON DAY ', ind) else
    writeln('SELL ON DAY ', ind);

end;

procedure solve;
var
  i, j : int;
  sm, sn : float;
  har, c : boolean;

begin
  har := f(n,m) > f(n,n) + eps;
  OUTnow(har,n);
  for i := n+1 to k do
  begin
    sm := f(i,m);
    sn := f(i,n);
    if (sm > sn + eps) <> har then
    begin
      har := sm > sn + eps;
      outnow(har,i);
    end;
  end;
end;

procedure readdata;
var
  i, j : int;
begin
  read(m,n,k);
  for i := 1 to k do read(a[i]);
end;

begin
  reset(input, cinfile);
  rewrite(output, coutfile);
  readdata;
  solve;
  outdata;
  close(output);
  close(input);
end.
