#include <stdio.h>
#include <math.h>

int a[10010], i, m, n, k, pm, pn, pn1, pm1;
double x;

int main() {
  freopen("easy.in", "rt", stdin);
  freopen("easy.out", "wt", stdout);

  scanf("%d %d %d", &m, &n, &k);
  for(i=0; i<k; i++){
    scanf("%lf", &x);
    a[i]=floor(x*100+0.5);
  }

  for(pn=i=0; i<n; i++) pn+=a[i];
  for(pm=0,i=n-m; i<n; i++) pm+=a[i];
  if(n*pm>m*pn) printf("BUY ON DAY %d\n", n);
  if(n*pm<m*pn) printf("SELL ON DAY %d\n", n);

  for(i=n; i<k; i++){
    pm1=pm-a[i-m]+a[i];
    pn1=pn-a[i-n]+a[i];

    if(n*pm1>m*pn1 && n*pm<m*pn) printf("BUY ON DAY %d\n", i+1);
    if(n*pm1<m*pn1 && n*pm>m*pn ) printf("SELL ON DAY %d\n", i+1);
    pm=pm1;
    pn=pn1;
  }
  return 0;
}