name = gets.chomp aiIndex = name.length if name[aiIndex - 2] == "a" && name[aiIndex - 1] == "i" name[aiIndex - 2] = "A" name[aiIndex - 1] = "I" else name += "-AI" end puts name