Raju is the Class Representative of his class. His teacher assigned him a task to enroll the students' entries in the class register. He is given two information about each student: name and age. Now the teacher asked him to enroll entries according to the students' age (youngest being first) and then the students will be assigned roll number according to the names in the register.

Given a roll number R, print the name of the student which has got that roll number.

Note:
Given all the students are of distinct ages.

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 each test case contains a single integer N denoting the number of students in the class.
Each of the next N lines contains an integer A denoting the age and a string S denoting the student's name, A and S being separated by a single space.
    The next line contains a single integer R denoting the required roll number.

Output

For each test case output a single line denoting the name of the student for the respective roll number.

Constraints

1 ≤ T ≤ 10
1 ≤ N ≤ 100
1 ≤ A ≤ 100
1 ≤ S.length ≤ 10
1 ≤ R ≤ N

SAMPLE INPUT
1
3
8 vaibhav
9 raju
11 prakhar
2

SAMPLE OUTPUT
raju
import sys
t=int(raw_input())

while(t>0):
	s=int(raw_input())
	fd={}
	while(s>0):
		sd=sys.stdin.readline().strip('\n').split()
		if(len(sd)!=0):
			fd[int(sd[0])]=sd[1]
		s=s-1
	x = sorted(fd)
	r=int(raw_input())
	ss=x[r-1]
	print fd[ss]
	t=t-1