{$APPTYPE CONSOLE}

var
  i,j,k,m,n:integer;
  a:array[1..100000] of extended;
  b:array[1..100000] of byte;
  sm,sn:extended;

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]);
  for i:=1 to 100000 do
    b[i]:=0;

  for i:=n to k do
  begin
    sm:=0;
    for j:=i-m+1 to i do
      sm:=sm+a[j];
    sm:=sm/(i-(i-m+1)+1);
    sn:=0;
    for j:=i-n+1 to i do
      sn:=sn+a[j];
    sn:=sn/(i-(i-n+1)+1);

    if sm>sn then
      b[i]:=1;
    if sm<sn then
      b[i]:=2;

    if (sm>sn) and ((i=n) or (b[i-1]=2)) then
    begin
      writeln('BUY ON DAY ',i);
      b[i]:=1;
    end;
    if (sm<sn) and ((i=n) or (b[i-1]=1)) then
    begin
      writeln('SELL ON DAY ',i);
      b[i]:=2;
    end;
 end;

end.
