#include<bits/stdc++.h>
using namespace std;

int main() {
	int n;
	while (scanf("%d", &n), n) {
		unordered_set<int>se;
		for (int i = 1; i < n; i++)se.insert(i*i%n);
		map<int, int>mp;
		for (auto i = se.begin(); i != se.end(); i++) {
			for (auto j = se.begin(); j != se.end(); j++) {
				if (i == j)continue;
				int d = *i - *j;
				if (d < 0)d += n;
				if (d > (n - 1) / 2) d -= n;
				mp[abs(d)]++;
			}
		}
		for (auto p : mp)printf("%d\n", p.second);
	}
}