Having written another programming contest, three Rabbits decided to grab some lunch. The coach gave the team exactly k time units for the lunch break.

The Rabbits have a list of n restaurants to lunch in: the i-th restaurant is characterized by two integers fi and ti. Value ti shows the time the Rabbits need to lunch in the i-th restaurant. If time ti exceeds the time k that the coach has given for the lunch break, then the Rabbits' joy from lunching in this restaurant will equal fi - (ti - k). Otherwise, the Rabbits get exactly fi units of joy.

Your task is to find the value of the maximum joy the Rabbits can get from the lunch, depending on the restaurant. The Rabbits must choose exactly one restaurant to lunch in. Note that the joy value isn't necessarily a positive value. 

Input

The first line contains two space-separated integers — n (1 ≤ n ≤ 104) and k (1 ≤ k ≤ 109) — the number of restaurants in the Rabbits' list and the time the coach has given them to lunch, correspondingly. Each of the next n lines contains two space-separated integers — fi (1 ≤ fi ≤ 109) and ti (1 ≤ ti ≤ 109) — the characteristics of the i-th restaurant.

Output

In a single line print a single integer — the maximum joy value that the Rabbits will get from the lunch. 

Examples

Input

2 5
3 3
4 5


Output

4


Input

4 6
5 8
3 6
2 3
2 2


Output

3


Input

1 5
1 7


Output

-1
import java.awt.Point;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
import static java.lang.Math.*;

public class A {
    void solve() throws IOException {
        int n = si(), k = si(), o = -INF;
        int[][] a = new int[n][2];
        for (int i = 0; i < n; i++) {
            int f = 0, t = 0;
            a[i] = new int[] { f = si(), t = si() };
            int j = t > k ? f - (t - k) : f;
            o = i==0 ? j : max(j, o);
        }
        System.out.println(o);
    }


    public static void main(String[] Args) throws IOException {
        new A().solve();
    }

    static int[] dx_ = { 0, 0, 1, -1 };
    static int[] dy_ = { 1, -1, 0, 0 };

    // ----------------------- Library ------------------------

    // ----------------------- GRAPH ------------------------

    /**
     * important for speed!!! PrintWriter out=new PrintWriter(new
     * OutputStreamWriter(System.out)); out.print(...); out.close();
     * 
     * @param v
     */
    // leap year is 29
    int[] year = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

    void initSystem() throws IOException {
        if (br != null)
            br.close();
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    void initFile() throws IOException {
        if (br != null)
            br.close();
        br = new BufferedReader(new InputStreamReader(new FileInputStream(
                "input.txt")));
    }

    void printWriter() {
        try {
            PrintWriter pr = new PrintWriter("output.txt");
            pr.println("hello world");
            pr.close();
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    void comparator() {
        Point[] v = new Point[10];
        Arrays.sort(v, new Comparator<Point>() {
            @Override
            public int compare(Point a, Point b) {
                if (a.x != b.x)
                    return -(a.x - b.x);
                return a.y - b.y;
            }
        });
    }

    double distance(Point a, Point b) {
        double dx = a.x - b.x, dy = a.y - b.y;
        return Math.sqrt(dx * dx + dy * dy);
    }

    Scanner in = new Scanner(System.in);

    String ss() {
        return in.next();
    }

    char[] sc() {
        return in.next().toCharArray();
    }

    String sline() {
        return in.nextLine();
    }

    int si() {
        return in.nextInt();
    }

    long sl() {
        return in.nextLong();
    }

    int[] sai(int n) {
        int[] a = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = in.nextInt();
        }
        return a;
    }

    int[] si(int n) {
        int[] a = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = in.nextInt();
        }
        return a;
    }

    String[] ss(int n) {
        String[] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = ss();
        }
        return a;
    }

    int[] sai_(int n) {
        int[] a = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextInt();
        }
        return a;
    }

    BufferedReader br;
    StringTokenizer tokenizer;
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    void tok() throws IOException {
        tokenizer = new StringTokenizer(br.readLine());
    }

    int toki() throws IOException {

        return Integer.parseInt(tokenizer.nextToken());
    }

    int[] rint(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < a.length; i++)
            a[i] = Integer.parseInt(tokenizer.nextToken());

        return a;
    }

    int[] rint_(int n) throws IOException {
        int[] a = new int[n + 1];
        for (int i = 1; i <= n; i++)
            a[i] = Integer.parseInt(tokenizer.nextToken());

        return a;
    }

    String[] rstrlines(int n) throws IOException {
        String[] a = new String[n];
        for (int i = 0; i < n; i++) {
            a[i] = br.readLine();
        }
        return a;
    }

    long tokl() {
        return Long.parseLong(tokenizer.nextToken());
    }

    double tokd() {
        return Double.parseDouble(tokenizer.nextToken());
    }

    String toks() {
        return tokenizer.nextToken();
    }

    String rline() throws IOException {
        return br.readLine();
    }

    List<Integer> toList(int[] a) {
        List<Integer> v = new ArrayList<Integer>();
        for (int i : a)
            v.add(i);
        return v;
    }

    static void pai(int[] a) {
        System.out.println(Arrays.toString(a));
    }

    static int toi(Object s) {
        return Integer.parseInt(s.toString());
    }

    static int[] dx3 = { 1, -1, 0, 0, 0, 0 };
    static int[] dy3 = { 0, 0, 1, -1, 0, 0 };
    static int[] dz3 = { 0, 0, 0, 0, 1, -1 };

    static int[] dx = { 1, 0, -1, 1, -1, 1, 0, -1 }, dy = { 1, 1, 1, 0, 0, -1,
            -1, -1 };

    static int INF = 2147483647; // =2^31-1 // -8
    static long LINF = 922337203854775807L; // -8
    static short SINF = 32767; // -32768

    // finds GCD of a and b using Euclidian algorithm
    public int GCD(int a, int b) {
        if (b == 0)
            return a;
        return GCD(b, a % b);
    }

    static List<String> toList(String[] a) {
        return Arrays.asList(a);
    }

    static String[] toArray(List<String> a) {
        String[] o = new String[a.size()];
        a.toArray(o);
        return o;
    }

    static int[] pair(int... a) {
        return a;
    }
}