require 'set'

loop do
  n = gets.to_i
  break if n==0
  next if n==1
  sqmod = Set.new
  1.upto(n-1) do |i|
    sqmod << i*i%n
  end
  f = Array.new((n-1/2),0)
  sqmod.each do |i|
    sqmod.each do |j|
      next if i==j
      div = i-j
      if(div<0)
        div+=n
      end
      if(div>(n-1)/2)
        div=n-div
      end
      f[div]+=1
    end
  end
  1.upto((n-1)/2) do |i|
    puts f[i]
  end
end