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

#define MAX_NUMBER 10000

int main()
{
	FILE* in;
	FILE* out;
	int i;
	int flag=0;
	long n,m,k;
	double sum=0;
	double a[MAX_NUMBER];
	double p_m=0;
	double p_n=0;

	in = fopen("easy.in", "rt");
	out = fopen("easy.out", "wt");
	fscanf(in, "%ld", &m);
	fscanf(in, "%ld", &n);
	fscanf(in, "%ld", &k);
	
	for(i=0;i<m;i++)
	{
		fscanf(in,"%lf",&a[i]);
		sum+=a[i];
	}
	p_m = sum/m;

	for(i=m;i<n;i++)
	{
		fscanf(in,"%lf",&a[i]);
		p_m = p_m + (a[i]-a[i-m])/(m*1.0);
		sum+=a[i];
	}
	p_n = sum/n;

	if(p_m > p_n){ flag=1; fprintf(out,"BUY ON DAY %d\n",i); }
	else { flag=0; fprintf(out,"SELL ON DAY %d\n",i); }
	
	for(i=n;i<k;i++)
	{
		fscanf(in,"%lf",&a[i]);
		p_m = p_m + (a[i]-a[i-m])/(m*1.0);
		p_n = p_n + (a[i]-a[i-n])/(n*1.0);
		if(p_m > p_n && flag == 0){ flag=1; fprintf(out,"BUY ON DAY %d\n",i+1); }
		if(p_m < p_n && flag == 1){ flag=0; fprintf(out,"SELL ON DAY %d\n",i+1); }
	}

	fclose(in);
	fclose(out);

	return 0;
}