const maxn=10000;
      readfile='easy.in';
      writefile='easy.out';

Var n,m,k,kol:longint;
    a:array[1..maxn] of real;
    pm,pn,pm1,pn1:array[1..maxn] of real;
    summ,sumn:real;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Procedure Rfile;
Var i1,j1:longint;
begin
     assign(input,readfile);
     reset(input);
     read(m,n,k);
     for i1:=1 to k do
         read(a[i1]);
     close(input);
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Procedure Main;
var i1,j1:longint;
begin
     for i1:=1 to n do
         sumn:=sumn+a[i1];
     for i1:=1 to m do
         summ:=summ+a[i1];
     kol:=m;
     pm[kol]:=summ/m;
     for i1:=m+1 to k do
     begin
          summ:=summ+a[i1]-a[i1-m];
          pm[i1]:=summ/m;
     end;
     kol:=n;
     pn[kol]:=sumn/n;
     for i1:=n+1 to k do
     begin
          sumn:=sumn+a[i1]-a[i1-n];
          pn[i1]:=sumn/n;
     end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Procedure Wfile;
var i1,j1:integer;
begin
     assign(output,writefile);
     rewrite(output);
     for i1:=n to k do
     begin
          if (pm[i1]>pn[i1]) and ((pm[i1-1]<pn[i1-1]) or (i1=n)) then
             writeln('BUY ON DAY ',i1);
          if (pm[i1]<pn[i1]) and ((pm[i1-1]>pn[i1-1]) or (i1=n)) then
             writeln('SELL ON DAY ',i1);
     end;
     close(output);
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
begin
     Rfile;
     Main;
     Wfile;
end.