<>;($a,$b,$c)=glob<>;$/=$";$\+=${($%+=++${$%}-length)+$c+$b+$a}&${$%+$c+$b}&${$%+$c}for<>;print