n = gets.to_i
ans = Array.new(n){[-1]*n}

i = 0
while i < n
  l = 1
  while i+l < n
    cnt = 0
    j = 0
    while i + j + l < n
      if ans[i+j][i+j+l] == -1
      ans[i+j][i+j+l] = l
      cnt += 1
      end
      if cnt % 2 == 1 && ans[i][i+j+l] == -1
        #p [i,j,l]
        ans[i][i+j+l] = l
      end
      j += l
    end
    if ans[i][n-1] == -1 && (n-1-i) % l == 0
      ans[i][n-1] = cnt % 2 == 0 ? l+1 : l
    end
    l += 1
  end
  i += 1
end

(n-1).times do |i|
  puts ans[i][i+1,n-1].join(" ")
end