시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 256 MB 321 239 204 73.913%

문제

우유부단한 연정이는 가장 좋아하는 수를 선택하기가 힘들다. 

그래서 주변 지인들에게 1 ~ 1000 사이에 있는 수들 중 각자 하나를 선택하여 쪽지에 적어 자신에게 달라고 했다.

하지만 유리멘탈을 가진 연정이는 수 많은 쪽지를 보자 그만 멘탈이 와르르 무너지고 말았다. 연정이를 대신하여 가장 많이 선택된 수를 골라주자. 

 ( 단, 가장 많이 선택된 수가 여러개라면 그 중 가장 작은 수를 출력하라 )

입력

첫 줄에는 전체 테스트 개수 [ N ] 가 주어진다. ( 1 ≤ N ≤ 100 )

각 테스트에는 쪽지개수 [ V ] 와 각 쪽지에 적혀있는 수 [ S ] 가 입력된다. ( 1 ≤ V , S ≤ 1000 )

출력

각 테스트마다 쪽지에서 가장 많이 선택된 수를 출력하시오.  ( 단 , 가장 많이 선택된 수가 여러개라면 그 중 가장 작은 수를 출력하라 )

예제 입력 1

3
3
42
42
19
4
7
99
99
7
5
11
12
13
14
15

예제 출력 1

42
7
11
W3sicHJvYmxlbV9pZCI6IjEwNTcwIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiRmF2b3JpdGUgTnVtYmVyIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM2YjBcdWM3MjBcdWJkODBcdWIyZThcdWQ1NWMgXHVjNWYwXHVjODE1XHVjNzc0XHViMjk0IFx1YWMwMFx1YzdhNSBcdWM4OGJcdWM1NDRcdWQ1NThcdWIyOTQgXHVjMjE4XHViOTdjIFx1YzEyMFx1ZDBkZFx1ZDU1OFx1YWUzMFx1YWMwMCBcdWQ3OThcdWI0ZTRcdWIyZTQuJm5ic3A7PFwvcD5cclxuXHJcbjxwPlx1YWRmOFx1Yjc5OFx1YzExYyZuYnNwO1x1YzhmY1x1YmNjMCBcdWM5YzBcdWM3NzhcdWI0ZTRcdWM1ZDBcdWFjOGMgMSB+IDEwMDAgXHVjMGFjXHVjNzc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