perl -e 'undef $/; $_=<>; tr/\n/ /; s/ $/\n/; print' list