#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while (cin >> n && n) {
int s[n][n];
for (int i = 0; i < n; i ++) {
for (int j = 0; j < n; j ++) {
s[i][j] = pow(2, i + j);
}
}
for (int i = 0; i < n; i ++) {
for (int j = 0; j < n; j ++) {
cout << s[i][j] << " ";
}
cout << endl;
}
cout << endl;
}
return 0;
}