Write a programs that reads the file Smart.txt & outputs the order from Most Smart to Least smart.
--Smart.txt Sam John John Michael Taylor Sam
In the above text file the person on the left is smarter than the person on the right. So we have to finally print the output as follows:
Taylor Sam John Michael
There can be multiple entries of name but we can always deduce who is the smarter than whom.
Another Example would be:
--Smart.txt Hank Jane Hal Scott Jane Scott Aaron Hank Tori Hal Hank Tori Hal Jane
Aaron Hank Tori Hal Jane Scott
The shortest code in bytes wins.