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

/*public class codewithritesh {

}

 */
import org.w3c.dom.css.CSSImportRule;
import org.w3c.dom.ls.LSOutput;

import javax.print.DocFlavor;
import javax.sql.rowset.serial.SQLOutputImpl;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.MutableAttributeSet;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.sql.SQLOutput;
import java.util.*;
import java.math.*;
import java.lang.reflect.Array;
import java.math.*;
import java.security.*;
import java.text.*;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
public class Main {
    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[10000]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)

                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }

    /* Used for sorting in different order based on different data*/
    class Node implements Comparable<Node> {
        int num;
        long weight;

        public Node(int num, long weight) {
            this.num = num;
            this.weight = weight;
        }

        @Override
        public int compareTo(Node n1) {
            if (this.weight == n1.weight) {
                return 0;
            }
            if (this.weight > n1.weight) {
                return 1;
            } else {
                return -1;
            }
        }
    }

    /*Graph Utility to create or implements graph operation*/
    class Graph {
        private int vertex;
        private ArrayList<Node> gList[];
        private int edges;

        public Graph() {
        }

        @SuppressWarnings("unchecked")
        public Graph(int vertex, int edges) {
            this.vertex = vertex;
            this.edges = edges;
            gList = new ArrayList[vertex + 1];
            for (int i = 1; i <= vertex; i++) {
                gList[i] = new ArrayList<Node>();
            }
        }

        public void addDoubleEdge(int start, int end, long weight) {
            Node n1 = new Node(end, weight);
            Node n2 = new Node(start, weight);
            gList[start].add(n1);
            gList[end].add(n2);
        }

        public void addSingleEdge(int start, int end, long weight) {
            Node n1 = new Node(end, weight);
            gList[start].add(n1);
        }
    }

    /*Class is used to compare from of two elements*/
    static class Comp {
        public int max(int first, int second) {
            if (first > second) {
                return first;
            } else {
                return second;
            }
        }

        public long max(long first, long second) {
            if (first > second) {
                return first;
            } else {
                return second;
            }
        }

        public int min(int first, int second) {
            if (first > second) {
                return second;
            } else {
                return first;
            }
        }

        public long min(long first, long second) {
            if (first > second) {
                return second;
            } else {
                return first;
            }
        }

        public int binarySearch(int arr[], int number) {
            int len = arr.length;
            int index = findElement(arr, 0, len - 1, number);
            return index;
        }

        public int binarySearch(long arr[], long number) {
            int len = arr.length;
            int index = findElement(arr, 0, len - 1, number);
            return index;
        }

        public int findElement(int arr[], int low, int high, int number) {
            if (high >= 1) {
                int mid = low + (high - 1) / 2;
                if (arr[mid] == number) {
                    return mid;
                }
                if (arr[mid] > number) {
                    return findElement(arr, low, mid - 1, number);
                } else {
                    return findElement(arr, mid + 1, high, number);
                }
            } else {
                return -1;
            }
        }

        public int findElement(long arr[], int low, int high, long number) {
            if (high >= 1) {
                int mid = low + (high - 1) / 2;
                if (arr[mid] == number) {
                    return mid;
                }
                if (arr[mid] > number) {
                    return findElement(arr, low, mid - 1, number);
                } else {
                    return findElement(arr, mid + 1, high, number);
                }
            } else {
                return -1;
            }
        }
    }

    /*Class is used to find gcd of all given number*/
    public static class GCD {
        public int find(int first, int second) {
            if (first == second) {
                return first;
            }
            if (first > second) {
                return prime(second, first);
            } else {
                return find(first, second);
            }
        }

        public long find(long first, long second) {
            if (first == second) {
                return first;
            }
            if (first > second) {
                return prime(second, first);
            } else {
                return prime(first, second);
            }
        }

        public int prime(int f, int s) {
            if (s % f == 0) {
                return f;
            } else {
                int x = s / f;
                return prime(x, f);
            }
        }

        public long prime(long f, long s) {
            if (s % f == 0) {
                return f;
            } else {
                long x = s / f;
                return prime(x, f);
            }
        }
    }

    public static void main(String[] args) throws IOException {
        // TODO Auto-generated method stub
        //Arrays.fill(arr,20); // sabko 20 fill karega
        Reader in = new Reader();
        /*int n,z;
        //scanf("%d",&n);
         n=in.nextInt();
        //int a[n],b[n-1];
        int []a = new int [n];
        int []b = new int [n-1];
        for(int i=0;i<n;i++)
            a[i]=in.nextInt();
        z=a[n-1]-a[0];
        for(int i=1;i<n-1;i++){
            for(int j=0;j<n-1;j++)
                b[j]=a[j+(j>=i)];
            int d=b[1]-b[0];
            for(int j=0;j<n-2;j++){
                int k=b[j+1]-b[j];
                if(k>d)d=k;
            }
            if(d<z)z=d;
        }
        System.out.println(z);

         */
        int n=in.nextInt();
        int k=in.nextInt();
        int max=Integer.MIN_VALUE;
        for(int i=0;i<n;i++){
            int f=in.nextInt();
            int t=in.nextInt();
            if(t<=k){
                max=Math.max(f,max);
            }else{
                int temp=f-(t-k);
                max=Math.max(max,temp);
            }
        }
        System.out.println(max);
    }
    public static long coprime(long a, long b) {
        if (b == 0) {
            return a;
        }
        return coprime(b, a % b);
    }
}