Heaps- Merge K sorted Arrays

Given K sorted arrays each with N elements merge them and output the sorted array

Input Format:
First line contains 2 integers K and N.

K is number of arrays.

N is number of elements in each array.

Constraints:
Elements of array <= |10^15| N <= 10^5 K <= 10

Output Format
Single line consisting of space separated numbers

Sample Input
3 4
1 3 5 7
2 4 6 8
0 9 10 11
Sample Output
0 1 2 3 4 5 6 7 8 9 10 11

My Code-

My code is giving output as- 0 1 2 3 4 5 6 7 8 9
it is not printing 10 and 11
Please point out the mistake.