#include <iostream>
#include <fstream>
using namespace std;

ifstream fin("easy.in", ios::in);
ofstream fout("easy.out", ios::out);

int main(){

	long n, m, k, last; double p[10001], summ=0, sumn=0, avern, averm;

	fin>>m>>n>>k;

	for (int i=1; i<=k; i++)
		fin>>p[i];

	for (i=n+1-m; i<=n; i++)
		summ+=p[i];

	for (i=1; i<=n; i++)
		sumn+=p[i];
	
	avern=sumn/n;
	averm=summ/m;

	i=n;

	if (averm>avern){
		fout<<"BUY ON DAY "<<i<<"\n";
	}

	if (averm<avern){
		fout<<"SELL ON DAY "<<i<<"\n";	
	}

	if ( averm>avern )
		last=1;
	else
		last=-1;	

	for (i=n+1; i<=k; i++){
		summ-=p[i-m];
		sumn-=p[i-n];
		summ+=p[i];
		sumn+=p[i];

		avern=sumn/n;
		averm=summ/m;

		if ( (averm>avern) && ( last==-1 ) ){
			fout<<"BUY ON DAY "<<i<<"\n";
		}

		if ( (averm<avern) && ( last==1 ) ){
			fout<<"SELL ON DAY "<<i<<"\n";	
		}

		if ( averm>avern )
			last=1;
		else
			last=-1;

	}

	return 0;
}
