A seismograph array logs an R-by-C grid of integer amplitude readings: R rows (sensors), each with C timed readings. To realign the log by time instead of by sensor, output the transpose of the grid: a C-by-R grid whose entry in row j, column i equals the original entry in row i, column j.
Input format
Line 1: two integers R and C.
Next R lines: each contains C space-separated integers (one grid row).
Output format
C lines, each with R space-separated integers: the transposed grid.
Constraints
- 1 <= R, C <= 200
- -1000000000 <= each reading <= 1000000000