#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
#include <cstdint>
using namespace std;
using LL = long long;

LL N, D, H;


template <std::uint_fast64_t Modulus> class modint {
	using u64 = std::uint_fast64_t;

public:
	u64 a;

	constexpr modint(const u64 x = static_cast<u64>(0)) noexcept
		: a(x% Modulus) {}
	constexpr u64& value() noexcept { return a; }
	constexpr const u64& value() const noexcept { return a; }
	constexpr modint operator+(const modint rhs) const noexcept {
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const noexcept {
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const noexcept {
		return modint(*this) *= rhs;
	}
	constexpr modint operator/(const modint rhs) const noexcept {
		return modint(*this) /= rhs;
	}
	constexpr modint& operator+=(const modint rhs) noexcept {
		a += rhs.a;
		if (a >= Modulus) {
			a -= Modulus;
		}
		return *this;
	}
	constexpr modint& operator-=(const modint rhs) noexcept {
		if (a < rhs.a) {
			a += Modulus;
		}
		a -= rhs.a;
		return *this;
	}
	constexpr modint& operator*=(const modint rhs) noexcept {
		a = a * rhs.a % Modulus;
		return *this;
	}
	constexpr modint& operator/=(modint rhs) noexcept {
		u64 exp = Modulus - static_cast<u64>(2);
		while (exp) {
			if (exp % static_cast<u64>(2) != static_cast<u64>(0)) {
				*this *= rhs;
			}
			rhs *= rhs;
			exp /= static_cast<u64>(2);
		}
		return *this;
	}
};

using mint = modint<99999999977>;

mint two[100];
mint ans[10][10];

int main() {
	two[0] = 1;
	vector<mint>vec;
	for (int i = 1; i < 100; ++i) {
		two[i] = two[i - 1] * 2;
		vec.push_back(two[i]);
	}
	cin >> N;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (i < j) {
				ans[i][j] = vec.back();
				vec.pop_back();
			}
			else if (i == j) {

			}
			else {
				ans[i][j] = ans[j][i];
			}
			cout << ans[i][j].a << " \n"[j == N - 1];
		}
	}
	return 0;
}