


Input:
3
3
4 6 8
3
2 5 7
2
1 9
Output:
1 2 4 5 6 7 8 9
Explanation:
First list is: 4 -> 6 -> 8 -> NULL
Second list is: 2 -> 5 -> 7 -> NULL
Third list is: 1 -> 9 -> NULL
The final list would be: 1 -> 2 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> NULL
The first line consists of an integer 'k' denoting the number of lists.
Next 2*k lines consists of 'n', the size of linked list and the 'n' space-separated elements on the new line.
The output consists of space-separated elements of the merged sorted list.
You do not need to print anything, it has already been taken care of. Just implement the given function.
Here we will perform a brute force of adding all the nodes in a separate list and then sort it.