#include<fstream.h>

const int max = 10009;

int main()
{
	ifstream cin("easy.in");
	ofstream cout("easy.out");
	int m,n,k,i;
	cin >> m >> n >> k;
	double pr[max];
	for(i = 1; i <= k ; i++)
		cin >> pr[i];
	double pn = 0, pm = 0, pn1 = 0, pm1 = 0;
	for (i = n-m+1; i <= n; i++)
		pm += pr[i];
	for (i = 1; i <= n; i++)
		pn += pr[i];
	i = n;
	while (i <= k)
	{
		if (pm/m > pn/n && (i == n || pm1/m < pn1/n))
			cout << "BUY ON DAY " << i << endl;
		if (pn/n > pm/m && (i == n || pn1/n < pm1/m))
			cout << "SELL ON DAY " << i << endl;
		pm1 = pm;
		pn1 = pn;
		pm -= pr[i-m+1];
		pm += pr[i+1];
		pn -= pr[i-n+1];
		pn += pr[i+1];
		i++;
	}
	return 0;
}