From the /etc/passwd file, extract the second field onwards, delimited by '#', then replace all spaces with '#', sort the output in reverse order by the first field, and print the second field only if it has not been printed before.
cut -f2- -d'#' /etc/passwd | tr ' ' '#' | sort -rk1 | awk -F'#' ' !x[$2]++ {print $2} '