You are a good student, when your teacher needs help you will be the first one that helps him. Now after the final examination, everyone has two kinds of scores, Math and English. You know nowadays English is very important, so the teacher will arrange your scores firstly according to your English score, then, according to Math. Now there are N(1<=N<=100000) students, everybody has his own scores and name .The teacher will ask you who is the Kth student after arranging them by score. We ensure that there are no two students have the same scores.
There are several tests.
In the first line there is two integers N , Q , represent there are N students and the teacher will ask Q (1<=Q<=1000) times . Then N lines follow, each line has three parts, the student’s name (the length is no longer than 20) the Math score and the English score (the scores are between 1 and 1000).Then following Q lines, each line contains a number K (1<=K<=N), means the teacher ask you the name of the Kth student after arranging them by scores.
There are Q lines of each test case; each line contains the answer of the teacher’s question.