#33665: _ans


j812018@nehs.hc.edu.tw (嗨)



#include<bits/stdc++.h>
using namespace std;

 

 

 


int main() {
    int a[100][100]={};
    int r,c;
    while(cin>>r>>c){
    for(int i=0;i<r;++i){
        for(int j=0;j<c;++j){
            cin>>a[i][j];
        }
    }
    for(int i=0;i<c;++i){
        for(int j=0;j<r;++j){
            cout <<a[j][i];
              if (j != r - 1){     
                                cout << " ";
                            }
        }
        cout <<endl;
    }
}
    return 0;

 

}