import scala.collection.mutable.{Set=>MSet} object Main { val Consonants = "nbmgr" val Vowels = "iaaeuu" def solve(usedNames: MSet[String]):String = { for (conps <- Consonants.permutations; vowps <- Vowels.permutations) { val cons = conps.toString val vows = vowps.toString val vowslast = vows.last.toString var tenchars = "" for ((c, v) <- cons zip vows) { tenchars += c tenchars += v } for (i <- 0 to 10) { val candidate = tenchars.patch(i, vowslast, 0) if (!usedNames(candidate)) { return candidate } } } return "NO" } def main(args: Array[String]): Unit = { val scanner = new java.util.Scanner(System.in) val n = scanner.nextInt() var usedNames = MSet() : MSet[String] for (_ <- 0 until n) { usedNames(scanner.next()) = true } val answer = solve(usedNames) println(answer) } }