You are given n segments on the coordinate axis Ox and the number k. The point is satisfied if it belongs to at least k segments. Find the smallest (by the number of segments) set of segments on the coordinate axis Ox which contains all satisfied points and no others.

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 106) — the number of segments and the value of k.

The next n lines contain two integers li, ri ( - 109 ≤ li ≤ ri ≤ 109) each — the endpoints of the i-th segment. The segments can degenerate and intersect each other. The segments are given in arbitrary order.

Output

First line contains integer m — the smallest number of segments.

Next m lines contain two integers aj, bj (aj ≤ bj) — the ends of j-th segment in the answer. The segments should be listed in the order from left to right.

Examples

Input

3 2
0 5
-3 2
3 8


Output

2
0 2
3 5


Input

3 2
0 5
-3 3
3 8


Output

1
0 5
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Edu4_D {
    public static void main(String[] args) throws IOException {
        InputReader ir = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int intervalsNo = ir.readInt();
        int K = ir.readInt();
        Point [] events = new Point[2*intervalsNo];
        Comparator<Point> comp = new Comparator<Point>() {
            public int compare(Point arg0, Point arg1) {
                if(arg0.x != arg1.x)
                    return arg0.x-arg1.x;
                return arg0.y-arg1.y;
            }
        };
        for (int i = 0; i < events.length; i+=2) {
            int start = ir.readInt();
            int end = ir.readInt();
            events[i] = new Point(start, -1);
            events[i+1] = new Point(end, 1);
        }
        Arrays.sort(events, comp);
        int cnt = 0, prevCnt = 0;
        Point curr = new Point(0, 0);
        ArrayList<Point> res = new ArrayList<Point>();
        for(int i = 0;i < events.length;i++) {
            cnt -= events[i].y;
            if(prevCnt == K && cnt == K-1) {
                curr.y = events[i].x;
                res.add(curr);
                curr = new Point(0, 0);
            } else if(prevCnt == K-1 && cnt == K) {
                curr.x = events[i].x;
            }
            prevCnt = cnt;
        }
        out.printLine(res.size());
        for(Point c:res)
            out.printLine(c.x+" "+c.y);
        out.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}