Python 2.7
1 n, m = map(int, raw_input().split()) 2 a = [list(raw_input().split()) for i in range(n)] 3 4 print '\n'.join([' '.join([a[i][j] for i in range(n)]) for j in range(m)])
1 n, m = map(int, raw_input().split()) 2 a = [list(raw_input().split()) for i in range(n)] 3 4 print '\n'.join([' '.join([a[i][j] for i in range(n)]) for j in range(m)])