{$APPTYPE CONSOLE}

Var n,m,k : integer;
        A : Array [1..10005] of Real;

Procedure Inp;
  Var i: INteger;
 Begin
  read(m,n,k);
  for i:=1 to k do read(a[i]);
 End;

Function cmp(a,b : real) : shortint;
 begin
   if a<b then cmp:=-1 else cmp:=1;
 End;

Procedure Solve;
  Var olds,i,sign : integer;
   pn,pm : Real;
 Begin
 sign:=0;
  for i:=1 to k do
   Begin
    if i<=n then pn:=pn+a[i];
    if i<=m then pm:=pm+a[i];
     if (i>n) then
      Begin
       pn:=pn-a[i-n];
       pn:=pn+a[i];
      End;
     if (i>m) then
      Begin
       pm:=pm+a[i];
       pm:=pm-a[i-m];
      End;
    if (i>=n) and (i>=m) then
     begin
      sign:=cmp(pm/m,pn/n);
      if sign<>olds then
       Begin
        if sign=1 then writeln('BUY ON DAY ',i);
        if sign=-1 then writeln('SELL ON DAY ',i);
       End;
      olds:=sign;
     End;
   End;
 End;

begin
 Assign(input,'easy.in');Reset(input);
 Assign(output,'easy.out');Rewrite(output);
 Inp;
 Solve;
end.
