<>=~s/.(.)/\@B[length($A[@A]=(sprintf"%b",$j=ord($&)*ord$1)=~s!0*$!!r)]/ger;/^/,print join("",map{(split"")[$']//$"}@A)=~s/ *$/ /r for 0..@B-2