#include<algorithm>
#include"vector"
#include<string>
#include<iostream>
#include<fstream>
using namespace std;

ifstream fi("easy.in");
ofstream fo("easy.out");
typedef vector<int> veci;typedef vector<double> vecd;typedef vector<string> vecs;

#define forn(i,n) if(true)for(int i=0;i<(n);i++)
#define feach(i,v) forn(i,((int)v.size()))
#define VA(v) v.begin(),v.end()

typedef long double ld;
ld a[21000];int k;

int main(){
	int m,n,k;
	fi>>m>>n>>k;

	ld cur=0;
	a[0]=cur;
	forn(i,k){
		ld prc;fi>>prc;
		cur+=prc;
		a[i+1]=cur;
	}

	double old=0;
	for(int i=1;i<=k;i++){
		if(i-m<0)continue;if(i-n<0)continue;
		ld sum1=a[i]-a[i-m];sum1/=m;
		ld sum2=a[i]-a[i-n];sum2/=n;
		ld delta=sum1-sum2;
		if(delta<0 && (i==n || old>0)){
			fo<<"SELL ON DAY "<<i<<endl;
		}
		if(delta>0 && (i==n || old<0)){
			fo<<"BUY ON DAY "<<i<<endl;
		}
		old=delta;
	}	
	return 0;
}