#include <iostream>
#include <stdio.h>
#define K 10001
#define N 101
#define M 101

using namespace std;

typedef struct
{
	int k,val;
}name;

int n =0,m =0 , k =0;
float p[K];
int trade[K];
float sum = 0.0;
float avn = 0.0, avm = 0.0;
int temp_n = 0, temp_m = 0;
name out[K];
int z = 0;



bool func(int temp_n, int temp_m,int i)
{
	float sum = 0.0;
	for(int j = temp_n; j <= i; j++)
	{
		sum += p[j];
		
	}
	avn = sum/(n);
	sum = 0.0;

	for( j = temp_m; j <= i; j++)
	{
		sum += p[j];
		
	}
	avm = sum/(m);

	if(avm > avn) return true;
	else return false;

}

int main()
{
	freopen("easy.in","r",stdin);
	freopen("easy.out","w",stdout);
	
	for(int i = 0; i < K; i++)
	{

		trade[0] = -1;
		p[i] = 0.0;
		out[i].val = 0;
		out[i].k = 0;
	}
	
	scanf("%i %i %i",&m,&n,&k);
	for(i = 1; i <= k; i++)
	{
		scanf("%f\n",&p[i]);
	}
	
	temp_n = n-n+1;
	temp_m = n-m+1;
	for(i = temp_n; i<= n; i++)
	{
		sum += p[i]; 
		
	}
	avn = sum/(n);
	sum = 0.0;
	
	
	for(i = temp_m; i <= n; i++)
	{
		sum += p[i]; 
		
	}
	avm = sum/(m);
	if(avm > avn)
	{
		trade[0] = 1;
		
	}
	else 
	{
		trade[0] = 0;
		
	}
	
	bool ex = false;
	for(i = n; i <= k; i++)
	{
		ex = false;
		temp_n = i-n+1;
		temp_m = i-m+1;
		ex = func(temp_n,temp_m,i);
		if(ex)
		{
			trade[i] = 1;
			if(trade[i-1] == 0 || i==n) 
			{
				out[z].val = 1;out[z].k = i; z++;
			}
		}
		else
		{
			trade[i] = 0;
			if(trade[i-1] == 1 || i==n)
			{
				out[z].val = 2;out[z].k = i; z++;
			}
		}
		
	}
	
	
	for(i = 0; i <= z; i++)
	{
		if(out[i].val == 1) printf("BUY ON DAY %i\n",out[i].k);
		else if(out[i].val == 2) printf("SELL ON DAY %i\n",out[i].k);
			 
	}	

	return 0;
}