import java.util.Scanner;
import java.lang.NullPointerException;
import java.io.FileNotFoundException;
import java.io.File;

class Oct23 {
	public static void main(String[] args) {

		Scanner kb = new Scanner(System.in);

		System.out.printf("Enter file name: ");
		String fileName = kb.next();

		Scanner fin = null;
		
		try {
			fin = new Scanner(new File(fileName));
		}
		catch(NullPointerException | FileNotFoundException ex) {
			System.out.println("Cannot access file");
			System.exit(0);
		}

		int len = fin.nextInt();
		System.out.printf("Number of scores: %d\n", len);	

		int[] scores = new int[len];

		for(int i = 0; i < len; i++) {
			scores[i] = fin.nextInt();
		}

		printArray(scores);

		int largest = scores[0];
		for(int elm : scores) {
			if(elm > largest) {
				largest = elm;
			}
		}
		System.out.printf("Largest: %d\n", largest);

	}

	static void printArray(int[] m) {
		for(int elm : m) {
			System.out.printf("%d ", elm);
		}
		System.out.println();
	}

}
