import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
 
void main() {
    int N, Q; scanf("%d %d\n", &N, &Q);
    struct P {
        int y;
        string name;
    }
    P[] X = new P[N];
    foreach (i; 0 .. N) {
        int Y; scanf("%d ", &Y);
        string Name = readln.chomp;
        X[i] = P(Y, Name);
    }
    X.sort!"a.y < b.y";
    string Ans = "kogakubu10gokan";
    int i = 0;
    for (int y = 1; y <= Q; y++) {
        if (X[i].y == y) {
            Ans = X[i].name;
            i++;
            if (i == N) break;
        }
    }
    writeln(Ans);
}