h = Hash.new{|h, k| h[k] = {}} n = gets.to_i if n == 0 puts "inabameguru" exit end n.times do str = gets.strip str.length.times do |i| h[i][str[i]] = true end end s = ["a", "i", "u", "e", "n", "b", "m", "g", "r"] ki = -1 kc = "" h.length.times do |i| s.each do |c| if h[i][c] == nil ki = i kc = c break end end break if ki != -1 end if ki != -1 b = "inabameguru" bc = b[ki] if bc == kc puts b exit end h2 = {} h2["a"] = true; h2["i"] = true; h2["u"] = true; h2["e"] = true h2["b"] = false; h2["g"] = false; h2["m"] = false; h2["r"] = false; h2["n"] = false if (h2[bc] && !h2[kc]) || (!h2[bc] && h2[kc]) b = "nabamegurui" end b.length.times do |i| if (h2[b[i]] == h2[kc]) && b[i] == kc b[i], b[ki] = b[ki], b[i] puts b exit end end else puts "NO" end