n = gets.to_i
ans = Array.new(n){[-1]*n}
if n % 2 == 0
  m = n
else
  m = n-1
end
k = 1
while k < m
  i=0
  while i+k < m
    ans[i][i+k] = 1
    i+=1
  end
  k+=2
end

n.times do |i|
  (i+1).upto(n-1) do |j|
    ans[i][j] = 2 if ans[i][j] == -1
  end
end
(n-1).times do |i|
  puts ans[i][i+1,n-1].join(" ")
end