def hoge() s = "" 18.times do s += (rand(26) + ?a.ord).chr end end n = gets.to_i n.times do |i| foo = hoge() if i + 1 == n puts "a" + hoge(h) + "n" else puts "a" + hoge(h) + "a" end end