import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    auto nk = readln.chomp.split.to!(long[]).array;
    long n = nk[0], k = nk[1];

    long[int] d;
    for (int i = 0; i < n; i++) {
        auto ab = readints;
        int a = ab[0], b = ab[1];

        d[a] += b;
    }

    // Warning: use std.algorithm.sort instead of .sort property
    int cnt = 0;
    foreach (x; d.keys.sort()) {
        if (k <= cnt + d[x]) {
            writeln(x);
            break;
        }
        cnt += d[x];
    }
}
