#include #define inf 1e9 using namespace std; typedef long long ll; int main() { //freopen("a.txt", "r", stdin); int n,m; cin >> n >> m; int matr[n][m]; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cin >> matr[i][j]; } } for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << matr[j][i] <<" "; } cout << endl; } return 0; }