Cross country running is a sport in which runners compete on a course laid out over natural outdoor terrain. A race course is usually 4 to 12 kilometers long and runs through woods or open land over grass and dirt, across hills and flat ground. The event ranks each runner individually, and those placings are used to compute a team score.
Each team is made up of six runners, and a team's score is the sum of the scores of its top four runners. Scores are awarded only to the runners of qualifying teams, in the order they cross the finish line. The team with the lowest total score wins. A team that does not field six runners is excluded from scoring. In case of a tie, the team whose fifth runner finished earlier wins.
For example, consider the following table.
| Place | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Team | A | B | C | C | A | C | B | D | A | A | C | A | C | C | A |
| Score | 1 | n/a | 2 | 3 | 4 | 5 | n/a | n/a | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
Teams B and D cannot be scored because they do not have six runners. Team A's score is 18 (1+4+6+7) and team C's score is 18 (2+3+5+8). Because the two teams tie, we look at the fifth runner to finish: team A's fifth runner has a smaller score than team C's, so team A is the winner.
Given the finishing order of every runner, write a program that finds the winning team. Note that a team with fewer than six runners is excluded from scoring. Assume that no team has more than six runners, that at least one team has six runners, and that every runner finishes the race.
Input is given on standard input. The input consists of T test cases. The first line contains an integer T, the number of test cases. Each test case is given on two lines. The first line of a test case contains a single integer N (6≤N≤1000). The second line contains N integers t1,t2,…,tN separated by spaces, where ti is the team number of the runner who finished in place i. Each team is represented by an integer between 1 and M (1≤M≤200).
Use standard output. For each test case, print the number of the winning team on its own line.