program easy;

{$APPTYPE CONSOLE}

var
	p	: array [0..10000] of real;
   pm, pn	: real;
   m, n, k	: integer;
   i, j		: integer;
   Was		: (NONE, BUY, SELL);

begin
	assign(input, 'easy.in');
   reset(input);
   assign(output, 'easy.out');
   rewrite(output);
   readln(m, n, k);
   p[0] := 0;
   for i := 1 to k do
   	readln(p[i]);
   pn := 0;
   for i := 1 to n do
   	pn := pn + p[i];
   pm := 0;
   for i := n - m + 1 to n do
   	pm := pm + p[i];
   Was := NONE;
   if pm/m > pn/n then begin
   	writeln('BUY ON DAY ', n);
   	Was := BUY;
   	end
   else if pm/m < pn/n then begin
   	writeln('SELL ON DAY ', n);
   	Was := SELL;
   end;

   for i := n + 1 to k do begin
   	pn := pn + p[i] - p[i - n];
      pm := pm + p[i] - p[i - m];
      if pm/m > pn/n then begin
      	if Was = SELL then
		   	writeln('BUY ON DAY ', i);
      	Was := BUY;
         end
      else if pm/m < pn/n then begin
      	if Was = BUY then
		   	writeln('SELL ON DAY ', i);
      	Was := SELL;
         end
      else
      	Was := NONE;
   end;
end.
