var i,m,n,k:longint;
    mas:array[1..10000] of extended;
    sm,sn,sm1,sn1:extended;
begin
  assign(input,'easy.in');
  reset(input);
  assign(output,'easy.out');
  rewrite(output);
  read(m,n,k);
  sn:=0;
  sm:=0;
  for i:=1 to k do
    read(mas[i]);
  for i:=n-m+1 to n do
    sm:=sm+(mas[i]/m);
  for i:=1 to n do
    sn:=sn+(mas[i]/n);
  if sm>sn then
    writeln('BUY ON DAY ',n) else
      writeln('SELL ON DAY ',n);
  for i:=n+1 to k do
    begin
      sn1:=sn;
      sm1:=sm;
      sm:=sm-(mas[i-m]-mas[i])/m;
      sn:=sn-(mas[i-n]-mas[i])/n;
      if (sn1>sm1) and (sn<sm) then
        writeln('BUY ON DAY ',i);
      if (sn1<sm1) and (sn>sm) then
        writeln('SELL ON DAY ',i);
    end;
  close(input);
  close(output);
end.
 