#include <iostream>
using namespace std;
const int MAX_SIZE = 10;
int main() {
int n, mt[MAX_SIZE + 1][MAX_SIZE + 1], newMt[MAX_SIZE + 1][MAX_SIZE + 1];
cin >> n;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
cin >> mt[i][j];
newMt[j][i] = mt[i][j];
}
}
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
cout << newMt[i][j] <<" ";
}
cout << "\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWF9TSVpFID0gMTA7CgppbnQgbWFpbigpIHsKCWludCBuLCBtdFtNQVhfU0laRSArIDFdW01BWF9TSVpFICsgMV0sIG5ld010W01BWF9TSVpFICsgMV1bTUFYX1NJWkUgKyAxXTsKCWNpbiA+PiBuOwoJZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgKytpKSB7CgkJZm9yIChpbnQgaiA9IDE7IGogPD0gbjsgKytqKSB7CgkJCWNpbiA+PiBtdFtpXVtqXTsKCQkJbmV3TXRbal1baV0gPSAgbXRbaV1bal07CgkJfQoJfQoJCglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQlmb3IgKGludCBqID0gMTsgaiA8PSBuOyArK2opIHsKCQkJY291dCA8PCBuZXdNdFtpXVtqXSA8PCIgIjsKCQl9CgkJY291dCA8PCAiXG4iOwoJfQoJCgkKCXJldHVybiAwOwp9