// Arup Guha
// 12/28/2017
// Solution to 2017 Dec USACO Gold Problem: Haybale Feast

import java.util.*;
import java.io.*;

public class hayfeast {

	public static int n;
	public static long min;
	public static long[] flavor;
	public static item[] spice;

	public static void main(String[] args) throws Exception {

		// Read in the flavor and spice.
		BufferedReader stdin = new BufferedReader(new FileReader("hayfeast.in"));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		n = Integer.parseInt(tok.nextToken());
		min = Long.parseLong(tok.nextToken());
		flavor = new long[n];
		spice = new item[n];
		for (int i=0; i<n; i++) {
			tok = new StringTokenizer(stdin.readLine());
			flavor[i] = Integer.parseInt(tok.nextToken());
			spice[i] = new item(Integer.parseInt(tok.nextToken()), i);
		}

		// Can't be worse than this.
		int res = 1000000000;

		TreeSet<item> ts = new TreeSet<item>();
		int j = 0;
		long sum = 0;

		// i is starting index of contiguous subsequence.
		for (int i=0; i<n; i++) {

			// Iterate until we have a segment with enough flavor.
			while (j < n && sum < min) {
				sum += flavor[j];
				ts.add(spice[j]);
				j++;
			}

			// Didn't work out, get out.
			if (j == n && sum < min) break;

			// This is the spiciness of this segment.
			res = Math.min(res, ts.last().value);

			// We are moving on, so sub this out.
			sum -= flavor[i];
			ts.remove(spice[i]);
		}

		// Ta da!
		PrintWriter out = new PrintWriter(new FileWriter("hayfeast.out"));
		out.println(res);
		out.close();
		stdin.close();
	}
}

class item implements Comparable<item> {

    public int value;
    public int ID;

    public item(int v, int i) {
    	value = v;
    	ID = i;
    }

    public int compareTo(item other) {
    	if (this.value != other.value) return this.value-other.value;
    	return this.ID-other.ID;
    }
}