#include <bits/stdc++.h>
using std::abs;
using std::bitset;
using std::cerr;
using std::cin;
using std::cout;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::unordered_map;
using std::unordered_set;
using std::vector;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using ld = long double;
template <typename T>
void _dbg(const char* s, T h) {
  cerr << s << " = " << h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* s, T h, Ts... t) {
  int b = 0;
  while (((b += *s == '(') -= *s == ')') != 0 || *s != ',') cerr << *s++;
  cerr << " = " << h << ",";
  _dbg(s + 1, t...);
}
struct init {
  init() {
    cin.tie(0);
    std::iostream::sync_with_stdio(0);
    cout << std::fixed << std::setprecision(10);
    cerr << std::fixed << std::setprecision(5);
  }
  ~init() {}
} init;
template <typename T, typename U>
void upx(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
void upn(T& x, U y) {
  if (x > y) x = y;
}
const ll N = 11;
ll g[N][N];
int32_t main() {
  ll n, p = 1;
  cin >> n;
  for (ll i = 1; i <= n; ++i) {
    for (ll j = 1, w = p; j <= n; ++j) {
      if (i == j) continue;
      g[j][i] = g[i][j] = w;
      w += p;
    }
    p *= 10;
  }
  for (ll i = 1; i <= n; ++i) {
    for (ll j = 1; j <= n; ++j) cout << g[i][j] << ' ';
    cout << '\n';
  }
  return 0;
}
