{$DEFINE DEBUG}

{$IFDEF DEBUG}
{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$ELSE}
{$A+,B-,C+,D-,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$ENDIF}

{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $02000000}
{$APPTYPE CONSOLE}

uses
  Math, SysUtils;

type
  int = longint;
  float = extended;

const
  maxn = 40000;
  cin_file = 'easy.in';
  cout_file = 'easy.out';
  eps : float = 1e-8;
  fmax : float = 1e40;
  besk = $3F3F3F3F;

var
  m,n,k : int;
  p1,p2,a : array[-maxn..maxn] of float;

procedure solve;
var
  i : int;
begin
  read(m,n,k);
  for i:=1 to k do read(a[i]);
  fillchar(p1, sizeof(p1), 0);
  fillchar(p2, sizeof(p2), 0);
  for i:=1 to k do p1[i]:=p1[i-1] + a[i] - a[i-m];
  for i:=1 to k do p2[i]:=p2[i-1] + a[i] - a[i-n];
  for i:=1 to k do p1[i]:=p1[i] / min(i, m);
  for i:=1 to k do p2[i]:=p2[i] / min(i, n);

  for i:=1 to k do
  begin
    if (p1[i] > p2[i] + eps) and ( ( i = n) or (p2[i-1] > p1[i-1] + eps)  ) then
      writeln('BUY ON DAY ', i)
    else
    if (p2[i] > p1[i] + eps) and ( ( i = n) or (p1[i-1] > p2[i-1] + eps)  ) then
      writeln('SELL ON DAY ', i);
  end;
end;

begin
  assign(input, cin_file);
  reset(input);
  assign(output,  cout_file);
  rewrite(output);

  solve;

  close(input);
  close(output);
end.