Death Gun is wreaking havoc in the world of SAO::J, and must be stopped! As the protagonist, it is your duty to hunt him down and prevent any more innocent gamers from being logged off! However, Death Gun is adept at hiding and has disguised himself as one of the users in the judge! You know that Death Gun, whoever he/she is, has an extensive information network, and some certain people may know their identity. You have obtained this information network from the admins of SAO::J, in the form of a list with items. Each item on the list is actually just a relation between user and . If you go to ask who Death Gun is, he/she will simply redirect you to user and then ask you to see them again; unless, you've already visited in which case they will gladly tell you their information. To save time, you would like to find out an order to visit all the users on your list so that you do not waste time being redirected. If there are multiple ways to do so, output the people who appear on the list before those that appear later. If you think you will be going in a loop at any point in your list, you should avoid that group of people altogether, as they may be trolls (don't output their names)! Also, if there is someone that tells you to visit someone that you won't visit due to loops, (or someone who is someone who wants you to visit someone that you don't want to visit due to loops, or etc.), don't visit them.
Note: A person may have several different people they want you to visit first.
Line 1: 1 integer , the number of items on your list
Next lines: 2 strings (with no spaces), space separated - and
On each line , output the name of the th person you should visit on your list.
3 Fataleagle Quantum Quantum Xyene Xyene DefinitelyNotDeathGun
DefinitelyNotDeathGun Xyene Quantum Fataleagle
Explanation for Sample
If you go to Fataleagle, he will redirect you to Quantum, who will redirect you to Xyene, who will redirect you to DefinitelyNotDeathGun. Therefore you should visit DefinitelyNotDeathGun first, then Xyene since you've already visited DefinitelyNotDeathGun, Quantum since you've visited Xyene, and then Fataleagle since you've visited Quantum.