There are N teams participating in a tournament. Each team is assigned an ID. In this tournament, the ID of the first team is 1, second team is 2, and so on till N. The strength of each team is decided by the strength that it contains in the following units:
Now, a team can win against another team if it can win at least 3 units. If a team's strength in a specific unit is higher than the other team, then the former team wins that specific unit. In case, the strength of both teams are the same in a specific unit, then the team that contains the lower team ID wins that unit.
The fixture of the tournament is decided as follows:
In each round, among the remaining teams, the team that is assigned the lowest team ID plays with the team that contains the next lowest team ID. For example, the team that contains the 3rd lowest ID plays with the team that is assigned the 4th lowest ID and so on.
Note: If a team loses a game, then it is out of the tournament.
Your task is to determine the winning team of the tournament and print its respective team ID.
Input format
Output format
For each test case, print the ID of the winning team in a separate line.
Constraints
1≤T≤101≤N≤1000001≤strength≤100N=2mwhere m=0,1,2,.....
During the fist round team 2 and 3 won their respective matches ,
in the next round team 2 won against team 3 .