#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

#include <algorithm>
using namespace std;

int n,m,a,b;

double S1,S2;

double qq;

int x[10001];
int S[10001];

int isUp(int day)
{
  S1=S[day]-S[day-m];
  S2=S[day]-S[day-n];

  S1/=m; S2/=n;
  return S1>S2;
}  

int isDown(int day)
{
  S1=S[day]-S[day-m];
  S2=S[day]-S[day-n];

  S1/=m; S2/=n;
  return S1<S2;
}  

int main()
{
  freopen("easy.in","r",stdin);
  freopen("easy.out","w",stdout);

  int i,k;

  scanf("%d %d %d",&m,&n,&k);

  S[0]=0;
  for(i=1; i<=k; i++) 
  {
    scanf("%lf",&qq);
    x[i]=int(floor(qq*100+0.1)+0.1);
    S[i]=S[i-1]+x[i];
  }

  for(i=n; i<=k; i++)
    if (isUp(i) && (i==n || isDown(i-1))) 
    {
      printf("BUY ON DAY %d\n",i);
    }
    else
    if (isDown(i) && (i==n || isUp(i-1)))
    {
      printf("SELL ON DAY %d\n",i);
    }

  return 0;
}