{$R+,Q+,O-}
var
  p: array[0..10010] of extended;
  a: array[0..10010] of integer;
  n, m, k, i: integer;
  s1, s2: extended;
begin
  reset(input, 'easy.in'); rewrite(output, 'easy.out');

  read(m, n, k);
  for i := 1 to k do read(p[i]);

  s1 := 0; s2 := 0;
  for i := n-m to n-1 do s1 := s1 + p[i];
  for i := 0 to n-1 do s2 := s2 + p[i];


  a[n-1] := 0;

  for i := n to k do begin
    s1 := s1 + p[i] - p[i-m];
    s2 := s2 + p[i] - p[i-n];

    if s1/m > s2/n then a[i] := 1;
    if s1/m < s2/n then a[i] := -1;

    if (a[i] = 1) and (a[i] <> a[i-1]) then writeln('BUY ON DAY ', i);
    if (a[i] = -1) and (a[i] <> a[i-1]) then writeln('SELL ON DAY ', i);
  end;
end.
