The young man from Chongqing -- Xiao Yan is a student of Chongqing University of Posts and Telecommunications (CQUPT). He was so addicted to the game "Genshin Impact" during the course of Linear Algebra that he couldn't extricate himself.
There are T groups of data. For each group of data, you are provided with an n×m matrix. Your task is to output the transpose of this matrix.
The transpose of a matrix is an operation that flips a matrix over its diagonal. That is, for an matrix with elements (where represents the row number and represents the column number, and ), its transpose, denoted as , is an matrix. In the transpose matrix , the element in the -th row and -th column of the original matrix becomes the element in the -th row and -th column of . In other words, if , then . For example, if we have a matrix , its transpose is , where the elements in the first row of the original matrix become the elements in the first column of the transposed matrix, and so on for other rows and columns.
输入格式
The first line contains an integer , representing the number of groups of data.
For each group of data:
The first line contains two integers n and m (1≤n,m≤1000), representing the number of rows and columns of the matrix respectively.
Then n lines follow, each line contains m integers aij (1≤aij≤1e9), representing the elements of the matrix.
输出格式
For each group of data, output the transpose of the input matrix. The transpose matrix should have m rows and n columns.
Each row of the output matrix should be printed on a separate line, and the elements in each row should be separated by a space.