require 'set'

ss = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 4, 3, 2, 1]
loop do
  n = gets.to_i
  break if n.zero?
  ms = Set.new
  (1..(n-1)).each do |x|
    ms << x**2 % n
  end
  cs = Array.new n/2, 0
  ms.to_a.combination 2 do |a, b|
    x = b - a
    x += n if x < 0
    x = n - x if x > n/2
    cs[x-1] += 1
  end
  puts cs.map {|c| c * 2 }
end