#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9;
const long long LINF = 4e18;
const long long delta = 96181;
const int N = 11;
long long a[N][N], fib[N * N], n, w[N][N];
vector<int> ans;
vector<pair<int, int> > e;
int main() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i - j) w[i][j] = (1 << i) + (1 << j);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << w[i][j] << ' ';
    cout << endl;
  }
}
