Randomly sort the output, take the last 20 lines, remove new line characters, reduce multiple spaces to single spaces, and replace spaces with semicolons.
sort -R | tail -20 | tr -d '\n' | tr -s ' ' | sed 's/ /;/g'