program Project1;

{$APPTYPE CONSOLE}
var
  m, n, k, i, j, t: integer;
  p: array [1..10000] of double;
  pm, pn : array[1..10000] of double;
begin
  Assign(Input, 'easy.in');
  Assign(Output, 'easy.out');
  read(m,n,k);
  for i:= 1 to k do
    readln(p[i]);

  for i:=n to k do begin
    t:= i-m+1;
    for j:=t to i do
      pm[i]:= pm[i] + p[j];
    pm[i]:= pm[i]/m;

    t:= i-n+1;
    for j:=t to i do
      pn[i]:= pn[i] + p[j];
    pn[i]:= pn[i]/n;

  end;

  for i:=n to k do begin
  if pm[i] > pn[i] then
    begin
       writeln('BUY ON DAY ', i);
       break;
    end;
  end;
  for i:=n to k do begin
    if pm[i] < pn[i] then
    begin
       writeln('SELL ON DAY ', i);
       break
    end;
  end;



  close(Input);
  close(Output);
end.
 