This simple program asks you to print the transpose of the matrix.
A transpose of a matrix A can be defined as a matrix AT where AT[i][j]=A[j][i].
So the Transpose of a matrix with dimensions M x N has dimensions N x M.

Input
It First gives an Integer T denoting Number of test cases.
Then Each Test case starts with two Intgeres on one line R and C,
denoting the number of rows and the number of columns respectively.
Then Follow R lines of input each containg C integers seperated by space.

Output
For each Test case ,
N lines of Output each containing M integers which represent the transpose of above matrix.

constraints
T<=50
R,C<=50

Sample Input
2
2 3
1 2 3
4 5 6
1 3
1 2 3

Sample Output
1 4
2 5
3 6
1
2
3

Problem Setter : Arjun Singh Bhatia

Languages: Brain,C,C++,Java,C#,JavaScript,Perl,PHP,Pascal,Python,Ruby,Text

Time Limit: 3 Second(s)
Score: 0 Point(s)
Input File Limit: 50000 Bytes

Mode Judge

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0