Олимпиадный тренинг

Задача 38249. Glory and trains


Slava has a lot of friends, and he really likes to meet with them. But, unfortunately, all of Slava's friends live in different cities (each in his own), to which Slava from his Big City can only get by train. Every time Slava decides to visit one of his friends, he faces a difficult choice — who exactly to go to this time. Slava loves all her friends very much and does not want to offend anyone. Therefore, he acts as follows: at some point in time, Slava leaves the house and goes to the station. After arriving at the station, Slava boards the nearest train, which goes to one of his friends. According to the known time of Slava's arrival at the station, help him find out which friend he will go to today.

Input
The first line of the input contains numbers M (1 ≤ M ≤ 105) — the number of electric trains that depart from the station, and the time T at which Slava arrives at the station (0 ≤ T ≤ 109). M lines follow, each containing two integers ti (0 ≤ ti ≤ 109, all ti are distinct) and fi (1 ≤ fi ≤ 109), where ti — the departure time of the i-th train (all ti are different), and fi corresponds to the number of the friend the i-th train goes to. It is guaranteed that there is at least one electric train that leaves later than time T.

Imprint
Print one number — the number of the friend that Slava will visit today.
Examples
# Input Output Explanation
1 5 74
28 3
85 2
6 1
5 3
72 1
2 It is believed that Slava catches the i-th train only if he arrives before the moment of its departure, i.e. T < ti.