You will be given a number of games in the input. The first line of input is a positive integer 6 <= m <= 18 indicating the number of games to follow. Each game starts with an integer indicating the number of moves that have been made in the game. The next m lines indicate the moves made by the two players in order, each of the form i j (with i < j) indicating that the line between i and j is filled in that move. You may assume that all given moves are legal.