#include <stdio.h>

#define NN 12000

FILE *fi, *fo;
double a[NN];
double p1[NN],p2[NN];
int n,m,k;
int has;

int min(int a, int b) { return (a<b)?a:b; }
int max(int a, int b) { return (a>b)?a:b; }

int main() {
	int i;
	double ddddd=0.75;
	fi=fopen("easy.in","rt");
	fo=fopen("easy.out","wt");

	fscanf(fi,"%d%d%d",&m,&n,&k);
	for(i=0;i<k;i++) {
		fscanf(fi,"%lf",&a[i]);
	}
	p1[m-1]=0;
	for(i=0;i<m;i++) {
		p1[m-1]+=a[i];
	}
	for(i=m;i<k;i++) {
		p1[i]=p1[i-1]+a[i]-a[i-m];
	}
/*	for(i=n-1;i<k;i++) {
		fprintf(fo,":%lf %lf\n",p1[i],p2[i]);
	}*/
	p2[n-1]=0;
	for(i=0;i<n;i++) {
		p2[n-1]+=a[i];
	}
	for(i=n;i<k;i++) {
		p2[i]=p2[i-1]+a[i]-a[i-n];
	}
	for(i=0;i<k;i++) {
		p1[i]/=(double)m;
		p2[i]/=(double)n;
	}
	if(p1[n-1]>p2[n-1]) {
		has=0;
	} else {
		has=1;
	}
/*	for(i=n-1;i<k;i++) {
		fprintf(fo,":%lf %lf\n",p1[i],p2[i]);
	}*/
	for(i=n-1;i<k;i++) {
		if(p1[i]>p2[i]) {
			if(!has) {
				fprintf(fo,"BUY ON DAY %d\n",i+1);
				has=1;
			}
		}
		if(p1[i]<p2[i]) {
			if(has) {
				fprintf(fo,"SELL ON DAY %d\n",i+1);
				has=0;
			}
		}
	}

	fclose(fi);
	fclose(fo);
	return 0;
}