program Project1;

{$APPTYPE CONSOLE}

var FileIn,FileOut:text;
    i,m,n,k:integer;
    a:array[1..20000] of extended;
    sm,sn:extended;
    wasBuy:boolean;
begin
  assign(FileIn,'easy.in');
  assign(FileOut,'easy.out');
  rewrite(FileOut);
  reset(FileIn);
  readln(FileIn,m,n,k);
  for i:=1 to k do
    read(FilEIn,a[i]);
  sn:=0;
  sm:=0;
  for i:=1 to n do
    sn:=sn+a[i];
  for i:=n-m+1 to n do
    sm:=sm+a[i];
  if (m*sn<n*sm) then
  begin
    writeln(FileOut,'BUY ON DAY ',n);
    wasBuy:=true;
  end
  else
  begin
    writeln(FileOut,'SELL ON DAY ',n);
    wasBuy:=false;
  end;
  for i:=n+1 to k do
  begin
    sn:=sn+a[i]-a[i-n];
    sm:=sm+a[i]-a[i-m];
  if (m*sn<n*sm) and (not wasBuy) then
  begin
    writeln(FileOut,'BUY ON DAY ',i);
    wasBuy:=true;
  end
  else
  if (m*sn>n*sm) and (wasBuy) then
  begin
    writeln(FileOut,'SELL ON DAY ',i);
    wasBuy:=false;
  end

  end;


  close(FileIn);
  close(FileOut);
end.
