You are in charge of putting together a guest list for a party, but because of a typical teenage high-school drama situation, there is one particular person who you don't want to find out about the event (let alone invite). Being exceptionally paranoid, you want to take the safe side, and not invite anyone who is friends with friends of the above mentioned person (or direct friends of that person) (or that person). Luckily you have a computer, and there is a certain social website that will tell you everybody's friends.
You want to invite your direct friends only; unless they match the restriction above.
The input file DATA3.txt will contain 5 sets of input. First line is the number of relationships to follow, 1 <= n < 100, followed by n lines in the person1 person2 format. Each relationship is considered mutual.
You always have an ID of 1; target person always has an ID of 2. All personIDs are integer values. There will always be IDs 1 and 2 in the sets.
The output file OUT3.txt will contain 5 lines - a space separated list of IDs of your direct friends to be invited, sorted in ascending order. In a special case where there is no one to invite, print "none", without quotes.
Note: you only trust yourself to stay quiet. If, for some odd reason, you are friends with personID-2, that doesn't actually cancel the entire party.
2 1 2 1 3 2 1 3 3 2 3 1 3 3 4 4 2 4 1 3 3 4 4 5 5 2 8 1 3 1 4 3 2 5 6 7 1 2 8 8 9 9 1
3 none none 3 4 7