Module Module1

    Sub Main()
        Dim instr() As String = Split(Console.ReadLine())
        Dim n As Integer = CInt(instr(0))
        Dim t As Integer = CInt(instr(1))
        Dim ans As Integer = 1000

        For i As Integer = 1 To n
            instr = Split(Console.ReadLine())
            Dim ci As Integer = CInt(instr(0))
            Dim ti As Integer = CInt(instr(1))
            If ti <= t And ci < ans Then
                ans = ci
            End If
        Next
        Console.WriteLine(ans)
    End Sub

End Module
