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.
The first line contains two integers *n* and *k* (1 ≤ *k* ≤ *n* ≤ 10<sup class="upper-index">6</sup>) — the number of segments and the value of *k*.

The next *n* lines contain two integers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub> ( - 10<sup class="upper-index">9</sup> ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) each — the endpoints of the *i*-th segment. The segments can degenerate and intersect each other. The segments are given in arbitrary order.
none
3 2
0 5
-3 2
3 8
2
0 2
3 5
3 2
0 5
-3 3
3 8
1
0 5
1 1
-1 1
1
-1 1
10 2
27 96
-22 45
-68 26
46 69
-91 86
12 73
-89 76
-11 33
17 47
-57 78
1
-89 86
10 1
3 60
-73 -37
59 69
-56 1
-84 -24
-14 46
-65 -23
-66 -57
-87 -80
-21 20
1
-87 69
10 10
-92 87
-100 -67
-88 80
-82 -59
-72 81
-50 30
30 77
65 92
-76 -60
-29 -15
0
1 1
-941727901 756748222
1
-941727901 756748222
1 1
-990637865 387517231
1
-990637865 387517231
1 1
-870080964 571991746
1
-870080964 571991746
10 8
-749560329 759073394
-186423470 816422576
-674251064 742056817
-342947007 954589677
-306243234 999298121
-448636479 409818446
-885248428 624359061
-936960294 754851875
-781500924 984124751
-342740564 618223559
1
-342740564 624359061
10 1
-260424665 -168566709
299109864 663179811
769984405 942516913
-998905510 -707148023
-167958021 60599275
658861231 718845364
79407402 279078536
13652788 79756488
-676213666 -339118351
-349156760 -258185154
5
-998905510 -707148023
-676213666 -168566709
-167958021 279078536
299109864 718845364
769984405 942516913
10 8
-278661264 757623461
-751226975 996393413
-721476675 863607399
-228431002 643113689
-209293138 701503607
-433870703 932866969
-385182911 667745533
-661057075 783312740
-617789923 657076219
-890369225 990071765
1
-278661264 667745533
4 2
2 2
2 2
2 3
3 3
2
2 2
3 3
2 2
-3 1
-4 -1
1
-3 -1
1 1
2 2
1
2 2
2 1
0 2
-1 0
1
-1 2
2 2
-1000000000 1000000000
-1000000000 100
1
-1000000000 100
n, k = map(int, input().split())
segment = list()
for _ in range(n):
    a, b = map(int, input().split())
    segment.append([a, 1])
    segment.append([b, -1])
segment.sort(key=lambda x: (x[0], -x[1]))
result = list()
left = None
for i in range(len(segment)):
    if i != 0:
        segment[i][1] += segment[i-1][1]
    if left is None and segment[i][1] >= k:
        left = segment[i][0]
    elif left is not None and segment[i][1] == k-1:
        result.append((left, segment[i][0]))
        left = None
print(len(result))
print("\n".join(map(lambda x: " ".join(map(str, x)), result)))
