/*
 * Created on 01.12.2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author B21
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

import java.io.*;
import java.util.ArrayList;

public class EasyTrading {

	public static void main(String[] args) throws IOException {
		
		StreamTokenizer in = new StreamTokenizer(new FileReader("easy.in"));
		in.nextToken();
		int m = (int) in.nval;
		in.nextToken();
		int n = (int) in.nval;
		in.nextToken();
		int k = (int) in.nval;
		
		ArrayList prices = new ArrayList();
		prices.add(null);
		for (int i = 0; i < k; i++) {
			in.nextToken();
			Double a = new Double(in.nval);
			prices.add(a);
			}
		boolean buy = false;
		boolean sell = false;
		
		FileWriter out = new FileWriter("easy.out");
		for (int i = n;i<=k;i++)
		{
            double pn = avg(n,prices,i);
            double pm = avg(m,prices,i);
            if (pm>pn && (!buy))
            {
            	out.write("BUY ON DAY "+String.valueOf(i)+"\r\n");
            	buy = true;
            	sell = false;
            }
            if (pn>pm && (!sell))
            {
            	out.write("SELL ON DAY "+String.valueOf(i)+"\r\n");
            	buy = false;
            	sell = true;
            }
		}
	out.close();	
	}
	
	public static double avg(int m,ArrayList p, int num)
	 {  
		double avg;
		double sum = 0;
		
		for (int i = num, j=0;j<m;i--,j++)
		{
			sum+=((Double) p.get(i)).doubleValue(); 
		}
		return sum/m;
	 }

	}

