1d;
s/\<.\>/0&/g;s/\<..\>/0&/g;s/\<...\>/0&/g;
s/ /<0123456789>/g;
:;s/\<\(\(\w*\)\(.\)\w*\)\(<\w*\3\w*\(.\)\w*>\)\(\2\5\w*\)\>/\6\4\1/g;t;
s/^\(\w*\)<.*>\(\w*\)$/\1-\2/;
s/\<0*//g;
/-/{s/.*/echo $((&))/e;q;};c0