import java.util.Scanner;

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

		Scanner kb = new Scanner(System.in);
/*	
		// Exam solution
		System.out.print("Enter 3 weights...");

		double weight1 = kb.nextDouble();	
		double weight2 = kb.nextDouble();	
		double weight3 = kb.nextDouble();	
			
		if(weight1 <= 0 || weight2 <= 0 || weight3 <= 0) {
			System.out.println("Error: ...");
			return;
		}

		double heaviest = weight1;

		if( weight2 > heaviest) {
			heaviest = weight2;
		}
		if (weight3 > heaviest) {
			heaviest = weight3;
		}

		System.out.printf("Heaviest weight: %f\n", heaviest);
*/

		// Read in 5 string and store them in an array
		// Capitalize each string

		String[] names = new String[5];

		System.out.println("Enter 5 names: ");
		for(int i = 0; i < names.length; i++) {
			String s = kb.next();
			// capitalize first character
			char firstChar = s.charAt(0);
			firstChar = Character.toUpperCase(firstChar);
			// create new string with capitalized letter and rest of string
			String end = s.substring(1); 
			String newString = String.format("%c%s", firstChar, end);
			// store new string in array
			names[i] = newString; 
		}

		// print the values in the array
		for(int i = 0; i < names.length; i++) {
			System.out.printf("%d: %s\n", (i + 1), names[i]);
		}

		// store the first characters of each string in an array
		char[] initials = new char[names.length];

		for(int i = 0; i < initials.length; i++) {
				String s = names[i];
				initials[i] = s.charAt(0);

				// print out the character
				System.out.printf("%d: %c\n", i+1, initials[i]);
		}

		// counting backward
		int[] items = { 1, 2, 3, 4, 5 };
		for(int i = items.length - 1; i >= 0; i--) {
			System.out.printf("%d ", items[i]);
		}
		System.out.println();


	


		


	}
}
