시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 1093 717 654 69.206%

문제

구단이 성적을 내지 못한다면 답은 새 선수 영입뿐이다. 이것은 오늘날 유럽 리그에서 가장 흔한 전략이고, 노르웨이의 로젠버그 팀은 이러한 전략이 성공한 대표적 예시다. 그들은 많은 스카우터들을 지구 곳곳에 파견해 가능성 있는 루키를 찾는다.

현재 첼시는 프리미어 리그에서 헤매고 있고, 결국 새로운 선수를 사기로 결정했다. 하지만 그들은 스카우터를 기다리기 지쳤고, 훨씬 더 효율적인 전략을 개발해냈다. "만약 무언가 팔리고 있다면, 그것에는 합당한 이유가 있다"는 배룸의 명언이 바로 그것이다. 축구에서 이 말은 곧 가장 비싼 선수가 가장 좋은 선수라는 이야기가 된다. 

이에 따라 새로운 선수를 찾는 방법은 단순히 구단들에게 전화를 걸어 그들의 가장 비싼 선수를 사는게 되었다. 당신의 임무는 첼시가 리스트에서 가장 비싼 선수를 찾아낼 수 있도록 돕는 것이다.

입력

첫 번째 줄에는 테스트 케이스의 개수 n이 주어진다 (n≤100). 

각 테스트 케이스의 첫 번째 줄 p는 고려해야될 선수의 수이다 (1≤p≤100).  

그 아래 p개의 줄에는 선수의 정보가 표시된다. 

각각의 줄은 선수의 가격 C 와 이름을 입력한다 (C<2*109).

  • 모든 선수의 가격은 서로 다르다. 
  • 선수의 이름은 20자 이하여야 하며, 사이에 공백이 있어서는 안된다.

 

출력

각각의 테스트 케이스에서 가장 비싼 선수의 이름을 출력해야한다.

예제 입력 1

2
3
10 Iversen
1000000 Nannskog
2000000 Ronaldinho
2
1000000 Maradona
999999 Batistuta

예제 출력 1

Ronaldinho
Maradona
W3sicHJvYmxlbV9pZCI6IjExMDk4IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjY2JjXHVjMmRjXHViOTdjIFx1YjNjNFx1YzY0MFx1YzkxOCEiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YWQ2Y1x1YjJlOFx1Yzc3N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