// Arup Guha
// 1/28/2026
// Solution to Question #1 for COP 3330 Quiz #7

import java.util.*;

public class quiz1q7 {

	public static void main(String[] args) {
	
		// Get user input.
		Scanner stdin = new Scanner(System.in);
		System.out.println("Please enter your first and last name.");
		String first = stdin.next();
		String last = stdin.next();
		
		// Handy to have to reduce typing.
		int len1 = first.length();
		int len2 = last.length();
		
		// This way we just check one case.
		if (first.toLowerCase().charAt(len1-1) == 'a' && last.toLowerCase().charAt(len2-1) == 'a')
			System.out.println("A+");
		else
			System.out.println("not a semifinalist");
	}
}