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.

Source: codechef | Difficulty: MEDIUM
Tags: Sorting


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()


def unique_number(arr):
	n = len(arr)
	if n == 1:
		return arr[0]
	if arr[0] != arr[1]:
		return arr[0]
	for i in range(1, n - 1):
		if arr[i - 1] != arr[i] and arr[i] != arr[i + 1]:
			return arr[i]
	if arr[-2] != arr[-1]:
		return arr[-1]
	return 0
t = int(input())
for it in range(t):
	n = int(input())
	arr = []
	mymap = {}
	for i in range(n):
		(name, num) = input().split()
		num = int(num)
		arr.append(num)
		mymap[num] = name
	arr = sorted(arr)
	smun = unique_number(arr)
	if smun == 0:
		print('Nobody wins.')
	else:
		print(mymap[smun])


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)


from collections import OrderedDict
for _ in range(int(input())):
	a = []
	min = 10000
	n = int(input())
	s = [0] * n
	l = [0] * n
	flag = 0
	for i in range(n):
		(s[i], t) = input().split()
		t = int(t)
		a.append(t)
	l = a.copy()
	a.sort()
	for x in range(len(a)):
		if a.count(a[x]) == 1:
			m = x
			flag = 1
			break
	if flag == 0:
		print('Nobody wins.')
	else:
		h = l.index(a[m])
		print(s[h])


t = int(input())
for i in range(t):
	n = int(input())
	d = {}
	c = 0
	for j in range(n):
		(a, b) = input().split()
		b = int(b)
		if b not in d.keys():
			d[b] = a
		else:
			d[b] = ''
	for k in sorted(d.keys()):
		if d[k] != '':
			print(d[k])
			c += 1
			break
	if c == 0:
		print('Nobody wins.')


for i in range(int(input())):
	n = int(input())
	x = {}
	for i in range(n):
		(s, a) = input().split()
		a = int(a)
		if a not in x.keys():
			x[a] = s
		else:
			x[a] = '-1'
	ans = 'Nobody wins.'
	m = 200000000001
	for i in x.keys():
		if i < m and x[i] != '-1':
			ans = x[i]
			m = i
	print(ans)


for i in range(int(input())):
	n = int(input())
	dic = {}
	for i in range(n):
		(s, a) = input().split()
		a = int(a)
		if a not in dic.keys():
			dic[a] = s
		else:
			dic[a] = '-1'
	result = 'Nobody wins.'
	minimo = 2000000001
	for i in dic.keys():
		if i < minimo and dic[i] != '-1':
			result = dic[i]
			minimo = i
	print(result)


from bisect import bisect_left
from code import interact
from heapq import heapify, heappush, heappop
from collections import deque
from pydoc import plain
import sys
from math import gcd, sqrt, log10, log2, floor, ceil, sqrt
input = sys.stdin.readline

def il():
	return [int(a) for a in input().strip().split()]

def ip():
	return input().strip()

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

def ot(in_p, *args, e=' '):
	if type(in_p) == list:
		print(*in_p, end=e)
	if type(in_p) == str or type(in_p) == int:
		print(in_p, end=e)
		for l in args:
			print(l, end=e)
	print()

def a_pwr_n(a, n, mod):
	if n == 1:
		return a % mod
	if n % 2 == 0:
		val = a_pwr_n(a, n // 2, mod)
		return val % mod * val % mod
	else:
		return a % mod * a_pwr_n(a, n - 1, mod) % mod

def rg(*ag):
	if len(ag) == 3:
		return range(ag[0], ag[1], ag[2])
	elif len(ag) == 2:
		return range(ag[0], ag[1])
	elif len(ag) == 1:
		return range(ag[0])
	else:
		raise 'invalid input'

def ispal(i, j, st):
	while i <= j:
		if st[i] == st[j]:
			i = i + 1
			j = j - 1
		else:
			return False
	return True
mod = 1000000000 + 7
dx = [-1, -2, 1, 2, 2, -2, -1, 1]
dy = [2, 1, 2, 1, -1, -1, -2, -2]
for _ in range(ii()):
	n = ii()
	d = {}
	for __ in range(n):
		(name, val) = input().split()
		if int(val) in d:
			d[int(val)].append(name)
		else:
			d[int(val)] = [name]
	ans = sorted(d)
	f = False
	for ele in ans:
		if len(d[ele]) == 1:
			f = True
			print(d[ele][0])
			break
	if not f:
		print('Nobody wins.')


import collections
t = int(input())
for _ in range(t):
	n = int(input())
	d = dict()
	l1 = list()
	d1 = dict()
	l2 = list()
	for _ in range(n):
		l = [x for x in input().split()]
		d[l[0]] = l[1]
		l1.append(int(l[1]))
	d1 = collections.Counter(l1)
	l1 = list()
	l2 = list(d1.keys())
	for x in range(len(l2)):
		if d1[l2[x]] == 1:
			l1.append(l2[x])
	if len(l1) == 0:
		print('Nobody wins.')
	else:
		for x in d:
			if d[x] == str(min(l1)):
				print(x)
				break


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = []
	d = {}
	while n:
		n -= 1
		l = input().split()
		v = int(l[1])
		if d.get(v) == None:
			d[v] = ['', 0]
		d[v][0] = l[0]
		d[v][1] += 1
	mini = float('inf')
	s = 'Nobody wins.'
	for i in d:
		if d[i][1] == 1:
			if mini > i:
				mini = i
				s = d[i][0]
	print(s)


t = int(input())
for tc in range(t):
	n = int(input())
	players = dict()
	for i in range(n):
		inputTmp = input().split(' ')
		name = inputTmp[0]
		num = int(inputTmp[1])
		if num not in players:
			players[num] = name
		else:
			players[num] = 0
	winner = False
	for num in sorted(players.keys()):
		if players[num] != 0:
			print(players[num])
			winner = True
			break
	if not winner:
		print('Nobody wins.')


import math
alf = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007

def createDic(nums):
	dic = dict()
	for i in nums:
		if not i in dic:
			dic[i] = 1
		else:
			dic[i] += 1
	return dic

def subarray_sum_max(nums):
	array = []
	suma_parcial = 0
	max_sum = 0
	index = 0
	se_refresco = True
	for i in range(len(nums)):
		suma_parcial += nums[i]
		if max_sum < suma_parcial:
			if se_refresco:
				array = []
				se_refresco = False
				index = i
			max_sum = suma_parcial
		if suma_parcial < 0:
			suma_parcial = 0
			se_refresco = True
		elif not se_refresco:
			array.append(nums[i])
	return (array, index, max_sum)

def particiones(nums, index, array):
	if index == len(nums):
		count = 0
	else:
		for i in array:
			i.append(nums[index])
			particiones(nums, index + 1, array)
			i.pop(len(i) - 1)
		array.append([])
		array[len(array) - 1].append(nums[index])
		particiones(nums, index + 1, array)
		array.pop(len(array) - 1)

def busqueda_binaria(nums, x, a_insertar):
	izq = 0
	der = len(nums) - 1
	while izq <= der:
		medio = int((izq + der) / 2)
		if nums[medio] == x:
			return medio
		elif nums[medio] > x:
			der = medio - 1
		else:
			izq = medio + 1
	if a_insertar:
		nums.insert(medio + 1, x)
	return -1

def solve():
	n = int(input())
	A = []
	nums = []
	for i in range(n):
		(a, b) = map(str, input().split())
		A.append((a, int(b)))
		nums.append(int(b))
	nums.sort()
	dic = createDic(nums)
	key = -1
	for i in dic:
		if dic[i] == 1:
			key = i
			break
	if key == -1:
		print('Nobody wins.')
	else:
		for i in range(len(A)):
			if A[i][1] == key:
				print(A[i][0])
				return
test = int(input())
while test != 0:
	solve()
	test -= 1


from collections import defaultdict

def call_value():
	return 0
t = int(input())
while t > 0:
	n = int(input())
	arr = []
	for _ in range(n):
		(s, m) = input().split()
		m = int(m)
		arr.append([s, m])
	dic = defaultdict(call_value)
	for i in arr:
		dic[i[1]] += 1
	ans = []
	for i in dic:
		if dic[i] == 1:
			ans.append(i)
	if len(ans) == 0:
		print('Nobody wins.')
	else:
		mini = min(ans)
		for i in arr:
			if i[1] == mini:
				print(i[0])
				break
	t -= 1


from collections import Counter
T = int(input())
for i in range(T):
	NM = []
	A = []
	z = 0
	N = int(input())
	for j in range(N):
		(nm, a) = input().split()
		NM.append(nm)
		A.append(int(a))
	D = Counter(A)
	K = sorted(D.keys())
	for k in K:
		if D[k] == 1:
			z = k
			break
		else:
			pass
	if z == 0:
		print('Nobody wins.')
	else:
		print(NM[A.index(z)])


for t in range(int(input())):
	n = int(input())
	s = input().split()
	num = int(s[1])
	s = s[0]
	d = dict()
	d1 = dict()
	d[num] = s
	d1[num] = s
	for i in range(1, n):
		s = input().split()
		num = int(s[1])
		s = s[0]
		if num in d:
			d[num] = None
			d1[num] = None
		else:
			d[num] = s
			d1[None] = s
	for i in d1:
		if d1[i] == None:
			d.pop(i)
	if len(d) == 0:
		print('Nobody wins.')
	else:
		print(d[min(d)])


t = int(input())
for _ in range(t):
	n = int(input())
	players = {}
	for i in range(n):
		(name, number) = input().split()
		number = int(number)
		if number in players:
			players[number].append(name)
		else:
			players[number] = [name]
	smallest_unique = float('inf')
	for number in players:
		if len(players[number]) == 1 and number < smallest_unique:
			smallest_unique = number
	if smallest_unique == float('inf'):
		print('Nobody wins.')
	else:
		print(players[smallest_unique][0])