def f1(n,a,b) # a<b
	t = n+a-b 
	if t > n/2
		n-t
	else
		t
	end
end

def f2(n,a,b) # a>b
	t = a-b
	if t > n/2
		n-t
	else
		t
	end
end

while (n=gets.to_i) != 0
	#n = 10000-1
	#st = Time.now
	xs = (1...n).map {|x|
		x*x % n
		}.uniq.sort
	
	arr = Array.new(n/2,0)
	xs.each_with_index do |a,idx|
		xs[idx+1..-1].each do |b|
			arr[f1(n,a,b)-1]+=1
			arr[f2(n,b,a)-1]+=1
		end
	end
	#p Time.now - st
	puts arr 
end