program e;

{$APPTYPE CONSOLE}

{$DEFINE DErdgBUG}

uses
  SysUtils;

const
  TaskName = 'easy';


var
  i, j, k, n, m : Integer;
  A : array [ 1 .. 10010 ] of Integer;
  fl : Extended;

procedure Solve();
  var
    i, j  : Integer;
    Pn, Pm : Integer;
    tr : integer;
  begin
    pm := 0;
    pn := 0;
    for i := (n-m+1) to n do
      Pm := Pm + a[i];
    Pm := n*Pm;

    for i := 1 to n do
      Pn := Pn + a[i];
    Pn := m*Pn;

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

begin
{$IFNDEF DEBUG}
  Assign( input, TaskName + '.in' );
  Assign( output, TaskName + '.out' );
  Reset(input);
  Rewrite(output);
{$ENDIF}

  Readln(m,n,k);
  for i := 1 to k do
    begin
      ReadLn(fl);
      A[i] := Round(fl*100);
    end;

  Solve();


{$IFNDEF DEBUG}
  Close(input);
  Close(output);
{$ELSE}
  ReadLn;
{$ENDIF}
end.
