s1 = ["pfnovu", "axqwuf", "mbgrihcdejkolsty"] s2 = ["orange","cipher","bqsuftlmdxynzvwj"] h = {} a=[] b=[] 3.times do |i| s1[i].size.times do |j| h[s1[i][j]] = s2[i][j] a.push(s1[i][j]) b.push(s2[i][j]) end end h[?z]=?k puts gets.chomp.split('').map{|c|h[c]}.join