#include<iostream>
#include<memory.h>
using namespace std;
int main(int argc, char *argv[]){
int m, n, k;
cin>>m>>n>>k;
float price[10000];
for(int i=0; i<k; i++){
cin>>price[i];
}
bool preIsBull;
for(int i=n-1; i<k; i++){
float pM=0;
float pN=0;
for(int j=0; j<m; j++){
pM+=price[i-j];
}
pM/=m;
for(int j=0; j<n; j++){
pN+=price[i-j];
}
pN/=n;
if(i==n-1){
if(pM>pN){
preIsBull=true;
cout<<"BUY ON DAY "<<i+1<<endl;
}else{
preIsBull=false;
cout<<"SELL ON DAY "<<i+1<<endl;
}
}else{
if(pM>pN){
if(!preIsBull){
cout<<"BUY ON DAY "<<i+1<<endl;
preIsBull=true;
}
}else{
if(preIsBull){
cout<<"SELL ON DAY "<<i+1<<endl;
preIsBull=false;
}
}
}
}
return 0;
}