#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
const int N = 20;
int m[N][N];
int main(void)
{
int n;
while (cin >> n) {
if (n == 0) break;
memset(m, 0, sizeof(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
m[i][j] = pow(2, i + j);
cout << m[i][j] << ' ';
}
cout << endl;
}
cout << endl;
}
return 0;
}