def  f(n,a,b)
	t = a-b
	if t < 0
		t+=n
	end
	if t > (n-1)/2
		n-t
	else
		t
	end
end

while (n=gets.to_i) != 0
	xs = (1...n).map {|x|
		x*x % n
		}.uniq
	arr = Array.new((n-1)/2,0)
	xs.each do |a|
		xs.each do |b|
			arr[f(n,a,b)-1]+=1 if a!=b
		end
	end
	puts arr 
end