program taskE;

{$APPTYPE CONSOLE}


var f : TextFile;
    i,m,n,k : integer;
    pm,pn,pi : array [1..10000] of double;
    bull : array [1..10000] of boolean;
    sum : double;

begin
  AssignFile(f,'easy.in');
  Reset(f);

  readln(f,m,n,k);
  for i:=1 to k do
    readln(f,pi[i]);
  CloseFile(f);

  sum := 0;
  for i:=1 to m do
    sum:=sum+pi[i];
  pm[m]:=sum/m;

  for i:=m+1 to k do
    pm[i]:=(pm[i-1]*m-pi[i-m]+pi[i])/m;

  sum := 0;
  for i:=1 to n do
    sum:=sum+pi[i];
  pn[n]:=sum/n;

  for i:=n+1 to k do
    pn[i]:=(pn[i-1]*n-pi[i-n]+pi[i])/n;


  for i:=n to k do
    bull[i]:=pm[i]>pn[i];

  AssignFile(f,'easy.out'); Rewrite(f);

  if bull[n] then
    writeln (f,'BUY ON DAY ',n)
  else
    writeln (f,'SELL ON DAY ',n);

  for i:=n+1 to k do
    begin
    if bull[i] and (not bull[i-1]) then
      writeln (f,'BUY ON DAY ',i);

    if (not bull[i]) and bull[i-1] then
      writeln (f,'SELL ON DAY ',i);

    end;

  CloseFile(f);
end.
