{$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}
program e;

{$APPTYPE CONSOLE}

type
  real = extended;
Var I,J,K,L,N,M:Longint;

  a: array[1..10100] of real;
  pm, pn: real;
  bull: boolean;

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]);
  pn := 0;
  for i := 1 to n do
    pn := pn+a[i];
  pn := pn/n;
  pm := 0;
  for i := 1+n-m to n do
    pm := pm+a[i];
  pm := pm/m;
  if pm>pn then
  begin
    writeln('BUY ON DAY ', n);
    bull := true;
  end
  else
  begin
    writeln('SELL ON DAY ', n);
    bull := false;
  end;
  for i := n+1 to k do
  begin
    pn := pn+(a[i]-a[i-n])/n;
    pm := pm+(a[i]-a[i-m])/m;
    if pm>pn then
    begin
      if not bull then
      begin
        writeln('BUY ON DAY ', i);
        bull := true;
      end;
    end
    else
    begin
      if bull then
      begin
        writeln('SELL ON DAY ', i);
        bull := false;
      end;
    end;
  end;
  Close(input);
  Close(output);
end.
 