$/=<>;$/=~n?s/(.)(.)/$\=$.$\;$1/ges:${$\.=$&.chop while s/.//s},print for<>