#include<iostream>
#include<set>
#include<cstring>

using namespace std;

set<int> SubData;
set<int>::iterator it,tmp;
int CntData[10000];

void solve(int n, int limit) {
	int result;

    //cout<<"result_before: "<<*it<<"-"<<*tmp<<"="<<result<<endl;
	result = *it - *tmp;
	while (result<0 || result>limit) {
		if (result < 0) {
			result += n;
		}
		else if (result > limit) {
			result = n - result;
		}
	}
	//cout<<"result_after:"<<result<<endl;
	CntData[result]++;
}

int main() {
	int n, limit;

	while (cin >> n, n) {
		SubData.clear();
		memset(CntData, 0, sizeof(CntData));
		limit = (n - 1) / 2;
		for (int i = 1; i < n; i++) {
			SubData.insert((i*i) % n);
		}
		for (it = SubData.begin(); it != SubData.end(); it++) {
			for (tmp = SubData.begin(); tmp != SubData.end(); tmp++) {
				if (*tmp == *it) {
					continue;
				}
				solve(n, limit);
			}
		}
		limit++;
		for (int i = 1; i < limit; i++) {
			if (CntData[i] != 0) {
				cout << CntData[i] << endl;
			}
		}

	}

	return 0;
}


