program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n, m, k: Integer;
    mask: array[1..10001] of Real;
    i, j, l: Integer;

    curn, curm: Real;
    oldb, newb: Integer;

begin
  AssignFile(Input, 'easy.in');
  Reset(Input);
  AssignFile(Output, 'easy.out');
  Rewrite(Output);

  Readln(m, n, k);

  for i := 1 to k do
    Readln(mask[i]);

  curn := 0;
  for i := 1 to n do
    curn := curn + mask[i];

  curm := 0;
  for i := n-m+1 to n do
    curm := curm + mask[i];

  if (curn / n) > (curm / m) then oldb := 1
                             else oldb := 0;


  i := n;
  j := 0;
  l := n-m;

  {newb := 1;

 if (oldb = 0) and (newb = 1) then }
      Writeln('BUY ON DAY ', n);

  repeat

    i := i + 1;
    curn := curn + mask[i];
    j := j + 1;
    curn := curn - mask[j];

    curm := curm + mask[i];
    l := l + 1;
    curm := curm - mask[l];

    if (curn / n) > (curm / m) then newb := 1
                               else newb := 0;

    if (oldb = 1) and (newb = 0) then
      Writeln('BUY ON DAY ', i)
    else
      if (oldb = 0) and (newb = 1) then
        Writeln('SELL ON DAY ', i);

    oldb := newb;

  until (i >= k);


  CloseFile(Input);
  CloseFile(Output);
end.

