program taske;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  avm,avn:extended;
  b:boolean;
	mas:array[1..10000] of extended;
  dyn1:extended;
  dyn2:extended;
	i,j,m,n,k:longint;
begin
  assign(input,'easy.in');
  assign(output,'easy.out');
  readln(m,n,k);
	for i:=1 to k do
  begin
    read(mas[i]);
  end;
  for i:=1 to n do
  begin
  	dyn1:=dyn1+mas[i];
    if i>n-m then
      dyn2:=dyn2+mas[i];
  end;
  for i:=n to k do
  begin
    avn:=dyn1/n;
    avm:=dyn2/m;
    if (i=n) or (b<>(avm>avn)) then
    begin
    	if (avm>avn) then
    	begin
    		writeln('BUY ON DAY ', i);
    	end
    	else
    		writeln('SELL ON DAY ',i);
    end;
    b:=avm>avn;

    if i<k then
    begin
    	dyn1:=dyn1-mas[i-n+1]+mas[i+1];
     	dyn2:=dyn2-mas[i-m+1]+mas[i+1];
    end;
  end;


end.
