Lucy had recently learned the game, called Natural Numbers.
The rules of the game are really simple. There are N players. At the same time, every player says one natural number. Let's call the number said by the i-th player Ai. The person with the smallest unique number (that is, the smallest number that was not said by anybody else) wins. Sometimes, there is a case when there are no unique numbers at all. Then the game is obviously a draw, so nobody wins it.
Sometimes, it's hard to determine the winner, especially, when the number of players is enormous. So in this problem, your assignment will be: given the names of the players and the numbers every of them have said. Please, tell the name of the winner, or determine that nobody wins.

-----Input-----
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.

The first line of every test case consists of a single integer N - the number of players. Then, N lines will follow. Each of these N lines will consist of the player's name and the number Ai said by her, separated by a single space.

-----Output-----
For each test case, output a single line containing an answer to the corresponding test case - the name of the winner, or a string "Nobody wins.", if nobody wins the game.

-----Example-----
Input:
2
5
Kouta 1
Yuka 1
Mayu 3
Lucy 2
Nana 5
2
Lucy 2
Nana 2

Output:
Lucy
Nobody wins.

-----Scoring-----
Subtask 1 (17 points): T = 10000, 1 <= N <= 10, 1 <= Ai <= 10 

Subtask 2 (19 points): T = 10000, 1 <= N <= 10, 1 <= Ai <= 2*109

Subtask 3 (30 points): T = 100, 1 <= N <= 1000, 1<= Ai <= 2*109

Subtask 4 (34 points): T = 10, 1 <= N <= 10000, 1 <= Ai <= 2*109

You can safely assume that in all the test cases the length of any name will not exceed five letters. All the players'  names  are unique.

Difficulty: MEDIUM

Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	hash = {}
	for i in range(n):
		(a, b) = map(str, input().split())
		l.append([a, b])
		try:
			hash[b]
		except:
			hash[b] = 1
		else:
			hash[b] += 1
	ans = []
	for i in l:
		(a, b) = i
		if hash[b] == 1:
			ans.append([int(b), a])
	ans.sort()
	if ans != []:
		print(ans[0][1])
	else:
		print('Nobody wins.')


try:
	t = int(input())
	while t:
		t -= 1
		n = int(input())
		arr = []
		obj = {}
		for i in range(n):
			(x, y) = input().split()
			y = int(y)
			arr.append([x, y])
			if y in obj:
				obj[y].append(x)
			else:
				obj[y] = [x]
		arr.sort(key=lambda i: i[1], reverse=True)
		while len(arr) and len(obj[arr[-1][1]]) > 1:
			arr.pop()
		if len(arr) == 0:
			print('Nobody wins.')
		else:
			print(arr.pop()[0])
except:
	pass


for _ in range(int(input())):
	n = int(input())
	a = []
	b = []
	for i in range(n):
		(name, score) = map(str, input().split())
		a.append([name, score])
		b.append(score)
	a.sort(key=lambda x: x[1])
	b.sort()
	i = 0
	while True:
		p = b.count(b[i])
		if p == 1:
			print(a[i][0])
			break
		else:
			i += p
			if i >= n:
				print('Nobody wins.')
				break


for _ in range(int(input())):
	n = int(input())
	a = {}
	b = {}
	c = {}
	for _ in range(n):
		(x, y) = input().split()
		y = int(y)
		a[x] = y
		b[y] = x
		try:
			c[y] += 1
		except:
			c[y] = 1
	ans = 1000000000000000000
	for i in c:
		if c[i] == 1:
			ans = min(ans, i)
	if ans == 1000000000000000000:
		print('Nobody wins.')
	else:
		print(b[ans])


t = int(input())
for i in range(t):
	n = int(input())
	d = dict()
	for i in range(n):
		s = input().split()
		if int(s[1]) in d:
			d[int(s[1])].append(s[0])
		else:
			d[int(s[1])] = [s[0]]
	l = sorted(d.keys())
	ans = 'Nobody wins.'
	for i in l:
		if len(d[i]) == 1:
			ans = d[i][0]
			break
	print(ans)


for _ in range(int(input())):
	np = int(input())
	dict = {}
	for i in range(np):
		(name, num) = input().split()
		num = int(num)
		if dict.get(num, -1) == -1:
			dict[num] = name
		else:
			dict[num] = 0
	arr = []
	for key in dict:
		arr.append(key)
	arr.sort()
	ans = -1
	for i in arr:
		if dict[i] != 0:
			ans = i
			break
	if ans != -1:
		print(dict[ans])
	else:
		print('Nobody wins.')


t = int(input())
while t:
	n = int(input())
	d = {}
	c = {}
	for i in range(n):
		(a, b) = input().split()
		d[a] = int(b)
		c[int(b)] = c.get(int(b), 0) + 1
	l = []
	for i in c:
		if c[i] == 1:
			l.append(i)
	if len(l) == 0:
		print('Nobody wins.')
	else:
		mini = min(l)
		for i in d:
			if d[i] == mini:
				print(i)
				break
	t -= 1


for i in range(int(input())):
	n = int(input())
	di = {}
	king = 0
	for j in range(n):
		(name, num) = input().split()
		num = int(num)
		if num not in di.keys():
			di[num] = name
		else:
			di[num] = ''
	for k in sorted(di.keys()):
		if di[k] != '':
			print(di[k])
			king += 1
			break
	if king == 0:
		print('Nobody wins.')


t = int(input())
list1 = []
list2 = []
newlist = []
for i in range(t):
	p = int(input())
	list1 = []
	list2 = []
	list3 = []
	newlist = []
	for j in range(p):
		s = input()
		(name, number) = s.split()
		number = int(number)
		list1.append(number)
		list2.append(name)
	for n in list1:
		if n not in newlist:
			newlist.append(n)
		elif n in newlist:
			list3.append(n)
	for m in list3:
		if m in newlist:
			newlist.remove(m)
	newlist.sort()
	if len(newlist) == 0:
		print('Nobody wins.')
	else:
		z = newlist[0]
		print(list2[list1.index(z)])


import sys
input = sys.stdin.readline

def rii():
	return range(int(input().strip()))

def ii():
	return int(input().strip())

def mii():
	return map(int, input().strip().split(' '))

def lmii():
	return list(map(int, input().strip().split(' ')))

def si():
	return str(input().strip())
from itertools import groupby
failure = 'Nobody wins.'

class Guess:

	def __init__(self, name, number):
		self.s = name
		self.n = int(number)

	def __lt__(self, other):
		return self.n < other.n

	def __gt__(self, other):
		return self.n > other.n

	def __le__(self, other):
		return self.n <= other.n

	def __ge__(self, other):
		return self.n >= other.n

	def __eq__(self, other):
		return self.n == other.n

def solve(*args):
	(n, players) = args
	uniques = [name for (freq, name) in [(len(list(y)), x.s) for (x, y) in groupby(players)] if freq == 1]
	return uniques[0] if len(uniques) > 0 else failure

def do_codechef():
	for t in rii():
		n = ii()
		players = list()
		for _ in range(n):
			players.append(Guess(*si().split(' ')))
		players.sort()
		print(solve(n, players))
do_codechef()
exit()


T = int(input())
for t in range(0, T):
	n = int(input())
	s = [0] * n
	np = [0] * n
	for i in range(0, n):
		(s[i], np[i]) = input().split()
		np[i] = int(np[i])
	no = np[:]
	no.sort()
	ans = '-1'
	if no[0] != no[1]:
		ans = no[0]
	else:
		for i in range(1, n - 1):
			if no[i] != no[i - 1] and no[i] != no[i + 1]:
				ans = no[i]
				break
			else:
				continue
		if ans == '-1' and no[n - 2] != no[n - 1]:
			ans = no[n - 1]
	for i in range(0, n):
		if ans == np[i]:
			ans = int(i)
			break
	if ans == '-1':
		print('Nobody wins.')
	else:
		print(s[ans])


from operator import itemgetter
t = int(input())
for _ in range(t):
	n = int(input())
	di = {}
	for i in range(n):
		(a, b) = input().split()
		b = int(b)
		di.setdefault(b, [])
		di[b].append(a)
	f = 0
	for item in sorted(di):
		if len(di[item]) == 1:
			print(di[item][0])
			f = 1
			break
	if f == 0:
		print('Nobody wins.')


def comp(a, b):
	if len(a) > len(b):
		return b
	elif len(b) > len(a):
		return a
	else:
		i = 0
		while True:
			if a[i] > b[i]:
				return b
			elif b[i] > a[i]:
				return a
			i += 1
for _ in range(int(input())):
	n = int(input())
	a = []
	b = []
	c = []
	for i in range(n):
		(name, score) = map(str, input().split())
		a.append([name, score])
		if score not in c:
			if score in b:
				b.remove(score)
				c.append(score)
			else:
				b.append(score)
	if len(b) == 0:
		print('Nobody wins.')
	else:
		ans = b[0]
		for i in range(1, len(b)):
			ans = comp(ans, b[i])
		for i in range(len(a)):
			if a[i][1] == ans:
				print(a[i][0])


for _ in range(int(input())):
	n = int(input())
	goes = []
	for u in range(n):
		z = input().split()
		goes.append((int(z[1]), z[0]))
	goes.sort()
	res = 'Nobody wins.'
	last = goes[0][0] - 1
	win = False
	for (val, nm) in goes:
		if val == last:
			win = False
		else:
			if win:
				res = lastnm
				break
			win = True
			lastnm = nm
			last = val
	if win:
		res = lastnm
	print(res)


for _ in range(int(input())):
	dic = {}
	for i in range(int(input())):
		(s, i) = input().split()
		e = int(i)
		if dic.get(e) == None:
			dic[e] = ['', 0]
		dic[e][0] = s
		dic[e][1] += 1
	q = 'Nobody wins.'
	mi = 10 ** 10
	for i in dic:
		if dic[i][1] == 1:
			if i < mi:
				mi = i
				q = dic[i][0]
	print(q)


for _ in range(int(input())):
	q = []
	for __ in range(int(input())):
		(a, b) = list(input().split())
		b = int(b)
		q.append((a, b))
	q = sorted(q, key=lambda x: x[1])
	i = 0
	win = ''
	if len(q) == 1:
		continue
	while i < len(q):
		t = q[i][1]
		if i == len(q) - 1 or q[i][1] != q[i + 1][1]:
			win = q[i][0]
			break
		while i < len(q) and q[i][1] == t:
			i += 1
		if i == len(q):
			break
	if win == '':
		print('Nobody wins.')
	else:
		print(win)


t = int(input())
while t:
	re = []
	st = {}
	m = {}
	for _ in range(int(input())):
		(a, b) = input().split()
		b = int(b)
		if b in list(st.keys()):
			st[b] += 1
		else:
			st[b] = 1
			m[b] = a
		re.append(int(b))
	count = 0
	re = list(set(re))
	re.sort()
	ind = 0
	for i in re:
		if st[i] == 1:
			count += 1
			ind = i
			break
	if count == 1:
		print(m[ind])
	else:
		print('Nobody wins.')
	t -= 1


s = int(input())
for i in range(s):
	n = int(input())
	m = dict()
	for i in range(n):
		sum = input().split()
		if int(sum[1]) in m:
			m[int(sum[1])].append(sum[0])
		else:
			m[int(sum[1])] = [sum[0]]
	l = sorted(m.keys())
	s1 = 'Nobody wins.'
	for i in l:
		if len(m[i]) == 1:
			s1 = m[i][0]
			break
	print(s1)