local bls, brs = bit.lshift, bit.rshift
local xor = bit.bxor
local n = io.read("*n")
local tbl = {}
for i = 1, n do
  tbl[i] = i
end
local tasks = {tbl}
local ret = {}
for i = 1, n - 1 do
  ret[i] = {}
  for j = i + 1, n do
    ret[i][j - i] = 0
  end
end
local function getlen(x)
  local len = 0
  for j = 1, 9 do
    len = len + x % 2
    x = brs(x, 1)
  end
  return len % 2
end
local levels = {1}
while 0 < #tasks do
  local level = levels[#levels]
  local tbl = tasks[#tasks]
  table.remove(levels)
  table.remove(tasks)
  local tn = #tbl
  for i = 1, tn - 1 do
    for j = i + 1, tn do
      if getlen(xor(i - 1, j - 1)) == 1 then
        ret[tbl[i]][tbl[j] - tbl[i]] = level
      end
    end
  end
  local tbl1 = {}
  local tbl2 = {}
  for i = 1, tn do
    local len = getlen(i - 1)
    if len % 2 == 0 then
      table.insert(tbl1, tbl[i])
    else
      table.insert(tbl2, tbl[i])
    end
  end
  if 1 < #tbl1 then
    table.insert(tasks, tbl1)
    table.insert(levels, level + 1)
  end
  if 1 < #tbl2 then
    table.insert(tasks, tbl2)
    table.insert(levels, level + 1)
  end
end
for i = 1, n - 1 do
  for j = i + 1, n do
    io.write(ret[i][j - i])
    io.write(j == n and "\n" or " ")
  end
end
