$~|=/ /?3:3x$'.3&1x$_.$~for<>;$~=~/31*$/;print@-