// Pr2dot1.java
// Earl Bergquist (with great suggestions from Ms. Martin of UW, Ms. Hess of Tahoma HS, 
//    and Mr. Davidson of Roosevelt HS)
// November 30, 2011  Garfield HS

/* This program is a sample showing how to add file reading for the 
   Programing Competition.
	
   It is a solution for PR2.1 of the April 2009 contest problem set where
   you read in a file (pr21.dat) with the first line in the data file is an integer 
   that represents the number of data sets to follow. Each data set will 
	contain one number that represents the number of times to print EASY. 
	
	This example first prompts for the name of the data set from console and
	then acts on that data set.  If that was not required, the file path & name
	would simply replace the variable inFile with double quotes around it, like this:
	    Scanner input = new Scanner(new File("E:/judge/pr21.dat"));
	Or if the file was simply in the current directory like this:
	    Scanner input = new Scanner(new File("pr21.dat"));
		 
	I hope this helps make you more comfortable using input files  */
	 
import java.util.*;	// for the Scanner
import java.io.*;		// for FileIO exceptions

public class Pr2dot1 {
	
	// The main method prompts at the console for the name of an input file
	// and opens it for reading. If the file can not be opened, the program
	// exits with a 'FileNotFoundException'.  The "throws FileNotFoundException"
	// is required in all main methods that uses an input file. 
	public static void main(String[] args) throws FileNotFoundException {
		
		// declare a Scanner to read from the console
		Scanner console = new Scanner(System.in);
		
		// get the name of the file to be opened
		System.out.print("input file name? ");
		String inFile = console.next();
		
		// now declare another Scanner to read from the file
		Scanner input = new Scanner(new File(inFile));
		
		// read the number of data lines in the file from the first line		
		int lineCount = input.nextInt();
		String str = input.nextLine();	// This takes us to the Next Line
		
		// Let's print what we found, this would NOT include this in your competition solution
		System.out.println("NOTE: Reading " + lineCount + " lines from '" + inFile + "'\n");
		
		// now use that lineCount in a for loop to read that many lines
		// from the file and echo them back to the console
		for (int line = 1; line <= lineCount; line++) {
			// We know that each line will only have an integer, 
			//    so we can read them as int Tokens
			int numberTimes = input.nextInt();
			for (int i = 1; i <= numberTimes; i++) {
				System.out.println("EASY");
			}
			System.out.println();
		}		
	}
}
