#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define lint long long
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, auto b){if (a < b) {a = b; return true;} return false;};
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail){
  std::cerr << " " << head;
  debug_impl(tail...);
}
#define debug(...) std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
  debug_impl(__VA_ARGS__);\
  std::cerr << std::noboolalpha;

template <typename T>
auto make_vector(size_t sz, T t) {
  return std::vector<T>(sz, t);
}
template <size_t N, typename T, typename U, std::enable_if_t<
  N == 1, std::nullptr_t> = nullptr>
auto make_higher_vector(size_t sz, U u) {
  return make_vector(sz, T(u));
}
template <size_t N, typename T, std::enable_if_t<
  N == 1, std::nullptr_t> = nullptr>
auto make_higher_vector(size_t sz) {
  return std::vector<T>(sz);
}
template <size_t N, typename T, typename... Args, std::enable_if_t<
  N != 1, std::nullptr_t> = nullptr>
auto make_higher_vector(size_t a, Args... args) {
  return make_vector(a, make_higher_vector<N - 1, T>(args...));
}
template <typename T, typename Size_t>
auto& at(T& t, Size_t i) {
  return t.at(i);
}
template <typename T, typename Size_t, typename... Args>
auto& at(T& t, Size_t i, Args... args) {
  return at(t.at(i), args...);
}

template <typename T>
std::istream& operator>> (std::istream& is, std::vector<T>& v)
{
  for (auto & x : v) is >> x;
  return is;
}

template <typename T>
std::ostream& operator<< (std::ostream& os, const std::vector<T>& v)
{
  auto n = v.size();
  os << "{";
  for (size_t i = 0; i < n; i++)
    os << (i > 0 ? "," : "") << v[i];
  return os << "}";
}

std::vector<std::pair<int, std::vector<std::vector<int>>>> memo(501);
bool ckd[501];

auto dfs(int n)
{
  if (ckd[n]) return memo.at(n);
  if (n == 1)
  {
    return std::make_pair(0, std::vector<std::vector<int>>{{-1}});
  }
  // debug(n);
  auto L = n / 2;
  auto R = n - n / 2;
  auto l_pair = dfs(L);
  auto r_pair = dfs(R);
  auto kind = std::max(l_pair.first, r_pair.first) + 1;
  auto l_ret = l_pair.second;
  auto r_ret = r_pair.second;
  auto ret = make_higher_vector<2, int>(n, n);
  for (auto i = 0; i < L; i++)
  {
    for (auto j = 0; j < L; j++)
    {
      at(ret, i, j) = at(l_ret, i, j);
    }
  }
  for (auto i = 0; i < R; i++)
  {
    for (auto j = 0; j < R; j++)
    {
      at(ret, L + i, L + j) = at(r_ret, i, j);
    }
  }
  for (auto i = 0; i < L; i++)
  {
    for (auto j = 0; j < R; j++)
    {
      at(ret, i, L + j) = at(ret, L + j, i) = kind - 1;
    }
  }
  ckd[n] = true;
  return memo.at(n) = std::make_pair(kind, ret);
}

int main()
{
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int n; std::cin >> n;
  auto pair = dfs(n);
  // auto num = pair.first;
  auto ret = pair.second;
  // debug(num, ret);
  for (auto i = 0; i < n - 1; i++)
  {
    for (auto j = i + 1; j < n; j++)
    {
      std::cout << (j > i + 1 ? " " : "") << at(ret, i, j) + 1;
    }
    std::cout << std::endl;
  }
  return 0;
}

Measured memory_bytes: 4864