A = %w(i a a e u u) B = %w(n b m g r) N = gets.to_i memo = Hash.new N.times do s = gets.chomp memo[s] = true end A.permutation(6).to_a.product(B.permutation(5).to_a).each do |a, b| s = '' 6.times do |i| s << a[i] s << b[i] if i < 5 end if memo[s].nil? puts s exit end end puts -1