N = gets.to_i

(N - 1).times do |b|
  i = N - b - 1

  a = []
  high_max_loop = 2
  max_loop = 2
  now_loop = 0
  i.times do |j|
    if j % 2 == 0
      a.push(1)
    else
      now_loop += 1
      a.push(now_loop + 1)
      if max_loop == now_loop
        max_loop += 1
        now_loop = 0

        if max_loop == high_max_loop
          high_max_loop += 1
          max_loop = 2
        end
      end
    end
  end
  puts a.join(' ')
end