puts$<.reduce.map{|s,i|s.tr i.chop!,i.reverse}.pop