#include <stdio.h>

int main(){
	//Input
	FILE *f=fopen("easy.in","rt");
	int m,n,k;
	float a[10001];
	fscanf(f,"%d %d %d",&m,&n,&k);
	for (int i=1;i<k+1;i++) fscanf(f,"%f",&a[i]);
	fclose(f);

	//Eval & output
	f=fopen("easy.out","wt");

	int oldflag=0,flag=0;
	/*
		-1 - bullish
		+1 - bearish
		 0 - first day
	*/

	//For each day from N to last do ...
	for (i=n;i<k+1;i++){
		float s1=0,s2=0;
		for (int j=0;j<m;j++) s1+=a[i-j];s1/=m;
		for (j=0;j<n;j++)     s2+=a[i-j];s2/=n;
		if (s1>s2) flag=-1;else flag=1;
		if (oldflag!=flag){
			if (flag==1) fprintf(f,"SELL ON DAY %d\n",i);
				   else  fprintf(f,"BUY ON DAY %d\n",i);
			oldflag=flag;
		}
	}
	fclose(f);
	return 0;
}