#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <math.h>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define REP(i,n) for (int i = 0; i < (n); i++)
#define IREP(i,n) for (i = 0; i < (n); i++)

int main()
{
   ifstream ifs("easy.in");
   ofstream ofs("easy.out");

   int n,m,k;
   ifs >> m >> n >> k;
   vector<double> pr(k);
   REP(i, k) {
      ifs >> pr[i];
   }

   double sn = 0;
   for (i = 0; i < n; ++i) sn += pr[i];
   double sm = 0;
   for (i = n-m; i < n; ++i) sm += pr[i];

   if (sn/n > sm/m) {
      ofs << "SELL ON DAY " << n << endl;
   } else {
      ofs << "BUY ON DAY " << n << endl;
   }

   double ld = sm/m-sn/n;
   for (i = n; i < k; ++i) {
      sm += pr[i]-pr[i-m];
      sn += pr[i]-pr[i-n];
      double cd = sm/m-sn/n;
      if (cd > 0) {
         if (ld < 0)
            ofs << "BUY ON DAY " << i+1 << endl;
      } else {
         if (ld > 0) 
            ofs << "SELL ON DAY " << i+1 << endl;
      }
      ld = cd;
   }

   return 0;
}