#!perl -aplF $\='';print;print"$F[$_-1] $F[-$_]",$"x(!!$_*@F-1)for 1-@F..0;$_=reverse