#include <fstream>
using namespace std;

const int MAX_K = 10000;

ifstream fin( "easy.in" );
ofstream fout( "easy.out" );

int M, N, K;
double P[ 1 + MAX_K ];

enum ESates
{
   UNKNOWN,
   BUY,
   SELL
};

void ReadData()
{
   int i;

   fin >> M >> N >> K;

   for( i = 1; i <= K; i++ )
      fin >> P[ i ];

   P[ 0 ] = 0;
}

void Work()
{
   int i;

   double nSum = 0.0;
   double mSum = 0.0;

   int state = UNKNOWN;

   for( i = 1; i <= N; i++ )
      nSum += P[ N - i ];

   for( i = 1; i <= M; i++ )
      mSum += P[ N - i ];

   for( i = N; i <= K; i++ )
   {
      nSum += P[ i ] - P[ i - N ];
      mSum += P[ i ] - P[ i - M ];

      if( nSum * M < mSum * N )
      {
         if( state != BUY )
         {
            fout << "BUY ON DAY " << i << endl;
            state = BUY;
         }
      }
      else
      {
         if( state != SELL )
         {
            fout << "SELL ON DAY " << i << endl;
            state = SELL;
         }
      }
   }
}

int main()
{
   ReadData();

   Work();

   return 0;
}
