#include <stdio.h>
#define MAXK 11000
#define MAX 110

int n,k,m;
double p[MAXK];
double Pm[MAXK];
double Pn[MAXK];

double Sum(int beg,int end)
	{
	double ret=0.0;
	int i;
	for (i=beg;i<=end;i++)
		ret+=p[i];
	return ret;
	}

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


	scanf("%d %d %d", &m, &n, &k);
	
	int i;
	for (i=1;i<=k;i++)
		scanf("%lf", &p[i]);


	for (i=n;i<=k;i++)
		{
		Pm[i]=Sum(i-m+1, i)/double(m);
		Pn[i]=Sum(i-n+1, i)/double(n);
		}

	for (i=n;i<=k;i++)
		{
		if (Pm[i]>Pn[i] && (i==n || Pm[i-1]<Pn[i-1])) printf("BUY ON DAY %d\n", i);
		if (Pm[i]<Pn[i] && (i==n || Pm[i-1]>Pn[i-1])) printf("SELL ON DAY %d\n", i);
		}

	return 0;
	}