#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
    cout.precision(20);
  }
} fast;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
template <typename T>
using PQ = priority_queue<T>;
template <typename T>
using minPQ = priority_queue<T, vector<T>, greater<T>>;
const long long dx[] = {1, 0, -1, 0};
const long long dy[] = {0, 1, 0, -1};
const long long dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long dx9[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
const long long dy9[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;
template <typename T1, typename T2>
inline bool chmin(T1 &a, const T2 &b) {
  if (a > b) a = b;
  return a > b;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, const T2 &b) {
  if (a < b) a = b;
  return a < b;
}
long long max(long long x, int y) { return max(x, (long long)y); }
long long max(int x, long long y) { return max((long long)x, y); }
long long min(long long x, int y) { return min(x, (long long)y); }
long long min(int x, long long y) { return min((long long)x, y); }
signed main() {
  int N;
  cin >> N;
  ll ans[10][10] = {};
  ll counter = 1;
  for (long long(i) = (0); (i) < (10); (i)++) {
    for (long long(j) = (i + 1); (j) < (10); (j)++) {
      if (i == 0) {
        ans[i][j] = ans[j][i] = 1;
        continue;
      }
      ans[i][j] = ans[j][i] = ((long long)((long long)1 << counter));
      counter++;
    }
  }
  for (long long(i) = (10 - N); (i) < (10); (i)++) {
    for (long long(j) = (10 - N); (j) < (10); (j)++) {
      cout << ans[i][j] << ' ';
    }
    cout << endl;
  }
}
