#include<iostream>#include<algorithm>usingnamespace std;constint N =1010;int n, m, g[N][N];intmain(){
cin >> n >> m;for(int i =0; i < n; i++)for(int j =0; j < m; j++)
cin >> g[i][j];for(int i = m -1; i >=0; i--){
for(int j =0; j < n; j++)
cout << g[j][i]<<' ';puts("");}return0;}