Goal
Your program has to indicate whether it is possible to make a single path with a series of dominoes.
Dominoes can be reversed and reordered as needed.
Input
Line 1: The number N of dominoes.
N next lines: Two integers A and B corresponding to the values of a domino.
Output
true if it is possible to make a single path with the dominoes.
false otherwise.
Constraints
2 ≤ N ≤ 20
0 ≤ A,B ≤ 6