#include <fstream.h>
#include <math.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

long M, N, K;
long double pr[10100];

void Input(){
	cin >> M >> N >> K;
	long i;
	for (i = 0; i < K; i++)
		cin >> pr[i];
}

void Solve(){
	long double avm = 0, avn = 0;
	long i;
	for (i = 0; i < M; i++)
		avm += pr[N - 1 - i];
	for (i = 0; i < N; i++)
		avn += pr[N - 1 - i];
	avm /= M;
	avn /= N;
	char res, newres;
	if (avm > avn) {
		res = 'B';
		cout << "BUY ON DAY " << N << endl;
	}
	else {
		res = 'S';
		cout << "SELL ON DAY " << N << endl;
	}
	for (i = N + 1; i <= K; i++) {
		avm *= M;
		avm += pr[i - 1] - pr[i - 1 - M];
		avm /= M;
		avn *= N;
		avn += pr[i - 1] - pr[i - 1 - N];
		avn /= N;
		if (avm > avn) {
			newres = 'B';
			if (newres != res) 
				cout << "BUY ON DAY " << i << endl;
		}
		else {
			newres = 'S';
			if (newres != res)
				cout << "SELL ON DAY " << i << endl;
		}
		res = newres;
	}
}

void Output(){
}
 
int main(){
	ifstream fi("easy.in");
	ofstream fo("easy.out");
	cin = fi;
	cout = fo;
	Input();
	Solve();
	Output();
	return 0;
}
