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.util.*;
import java.io.*;
public class B{
	static class pair implements Comparable<pair>{
		int point; int event;
		public pair(int a, int b)
		{
			point = a;
			event = b;
		}
		@Override
		public int compareTo(pair p) {
			if(point != p.point)return Integer.compare(point,p.point);
			return -Integer.compare(event,p.event);
		}
		
	}
	public static void main(String[] args)
	{
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = fs.nextInt(); int k = fs.nextInt();
		
		List<pair> arr = new ArrayList();
		
		for(int i=0;i<n;i++)
		{
			int l = fs.nextInt(); int r = fs.nextInt();
			pair event1 = new pair(l,1);
			pair event2 = new pair(r,-1);
			
			arr.add(event1); arr.add(event2);
		}
		
		Collections.sort(arr);
		
		int cur = 0;
		List<Integer> ans = new ArrayList();
		for(pair e:arr)
		{
			int pos = e.point;
			int type = e.event;
			
			if(type == 1)
			{
				if(cur == k-1)
				{
					ans.add(pos);
				}
				cur += 1;
			}
			else
			{
				if(cur == k)
				{
					ans.add(pos);
				}
				cur -= 1;
			}
		}
		
		out.println(ans.size()/2);
		
		for(int i=0;i<ans.size();i+=2)
		{
			out.println(ans.get(i)+" "+ans.get(i+1));
		}
		
		out.close();
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
	public static int[] sort(int[] arr)
	{
		List<Integer> temp = new ArrayList();
		for(int i:arr)temp.add(i);
		Collections.sort(temp);
		int start = 0;
		for(int i:temp)arr[start++]=i;
		return arr;
	}
	public static String rev(String str)
	{
		char[] arr = str.toCharArray();
		char[] ret = new char[arr.length];
		int start = arr.length-1;
		for(char i:arr)ret[start--] = i;
		String ret1 = "";
		for(char ch:ret)ret1+=ch;
		return ret1;
	}
}