str = gets.chomp list = str.split("") print str puts list[list.size - 2] == "a" && list[list.size - 1] == "i" ? "AI" : "-AI"