//* Problem  : E. Easy Trading
//* Contest  : NEERC-2003
//* Type     : Solution
//* Date     : 2008.08.01
//* Author   : alt
//* Language : C++
//* Compiler : Microsoft Visual C++ 6.0

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

typedef pair <int,int> PIII;
typedef vector <int> VI;
typedef vector <vector<int> > VVI;
typedef vector <pair<int,int> > VPII;
typedef vector <vector<pair<int,int> > > VVPII;

#define int64 long long
#define PI (2.0 * acos(0.0))
#define MP make_pair
#define PB push_back
#define SZ(a) (int)a.size()
#define FOR(i, n) for (int i = 0; i < (int)n; i++)
#define FORSZ(i, a) FOR(i, SZ(a))
#define FORE(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)
#define FORR(i, a, b) for (int i = (int)(a); i >= int(b); i--)
#define INF 1000000000
#define INFL 1000000000000000000LL
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()

inline int si(){int tt; scanf("%d", &tt); return tt;}

int n, m, k;

double a[10000];

int sign(double vk, double vm)
{
	if (vk/k > vm/m) return 1;
	return -1;
}

void solve()
{
	double sum_k = 0, sum_m = 0;
	FOR(i, k) sum_k += a[i];
	for (int i = k - m; i < k; i++) sum_m += a[i];
	//printf("BUY ON DAY %d\n", k);
	if (sign(sum_k, sum_m) < 1)
		printf("BUY ON DAY %d\n", k);
	else
		printf("SELL ON DAY %d\n", k);

	for (int i = k; i < n; i++)
	{
		int s1 = sign(sum_k, sum_m);
		sum_k = sum_k - a[i-k] + a[i];
		sum_m = sum_m - a[i-m] + a[i];
		int s2 = sign(sum_k, sum_m);
		if (s1 == -s2 && s1)
		{
			if (s1 == 1)
				printf("BUY ON DAY %d\n", i + 1);
			else
				printf("SELL ON DAY %d\n", i + 1);
		}
	}
}

void result()
{
}

int main()
{
#ifdef _DEBUG
	freopen("1064", "r", stdin);
#endif
	m = si();
	k = si();
	n = si();
	FOR(i, n)
		scanf("%lf", a + i);
	solve();
	result();
	return 0;
}

