Clothing
In the Enchanted Land, despite its small size, a diverse range of peoples reside, each with unique cultural and physical characteristics, yet all sharing a common language. Each group prefers clothing of a distinct color, different from that of other groups. The traditions of these peoples vary, and sometimes they even contradict each other. Consequently, in each city, the traditions followed are those of the people who are most numerous. If there is a tie, the city defaults to the traditions of the most peace-loving group, identified by their white clothing (represented by zero).
A traveler, standing on a hill overlooking the city, can observe the clothing color of every inhabitant. As he prepares to enter the city, he needs to quickly ascertain which traditions are predominant.
Input Data
The first line contains the number of test cases. Each test case consists of two lines. The first line of a test case provides the number n (1 ≤ n ≤ 10^4
), representing the number of city inhabitants visible to the traveler. The second line lists n natural numbers, separated by spaces, where each number c[i]
(1 ≤ c[i]
≤ 10^2
) indicates the clothing color of the i-th inhabitant.
Output Data
For each test case, output a single number on a separate line, representing the clothing color of the people whose traditions are followed by the city's inhabitants.