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

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


double pm[100000];
double pn[100000];
double p[100000];
int m, n, lines;

int isbull (int a) {
	if (a < m-1) return 0;
	if (a < n-1) return 0;
	if (pm[a] > pn[a]) return -1;
	return 1;
}

int ischange (int a) {
	if (isbull(a-1) == isbull (a)) return 0;
	if (isbull(a-1) < isbull(a)) return 1;
	return -1;
}


int main () {
	int i;
	fin >> m >> n >> lines;
	for (i=0; i<lines; i++) {
		fin >> p[i];
	}

	double sum = 0;
	for (i=0; i<m; i++) {
		sum += p[i];
	}
	for (i=m; i<lines; i++) {
		pm[i-1] = sum/m;
		sum -= p[i-m];
		sum += p[i];
	}

	sum = 0;
	for (i=0; i<n; i++) {
		sum += p[i];
	}
	for (i=n; i<lines; i++) {
		pn[i-1] = sum/n;
		sum -= p[i-n];
		sum += p[i];
	}

	int last = 0;
	for (i=0; i<lines; i++) {
		switch (ischange(i)) {
		case 0: break;
		case -1: fout << "BUY ON DAY " << i+1 << endl; last = -1; break;
		case 1:fout << "SELL ON DAY " << i+1 << endl; last = 1; break;
		}
	}
	if (last == -1) {
	//	fout << "SELL ON DAY " << lines << endl;
	}

	return 0;
}