Big array of Dino
Once, when Dino was solving a problem related to arrays, he saw that the size of all arrays is at most . Since Dino is a dinosaur, this number seemed very small to him. Therefore, he decided to create a big array.
Dino first creates an empty array and selects pairs of numbers: . Then for each of these pairs he inserts into array the number times. For example,if the first pair is , the number will be inserted into array times. After that, Dino decides to arrange this array in non-decreasing order, but since the array is very large, Dino's computer cannot perform this arrangement. He is interested in the -th (the array is numbered starting from ) number. Help Dino to find this number.
Input
First line contains number . Each of the next lines contains pair . The last line contains number . It is guaranteed that -th number exists in array.
Output
Print the -th number in non-decreasing array.