#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<numeric>
#define INF 1e+8
#define EPS 1e-9
#define PB push_back
#define fi first
#define se second
#define reps(i,j,k) for(int i = j; i < k; i++)
#define rep(i,j) reps(i,0,j)
using namespace std;
const int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
typedef long long ll;
typedef pair<int,int> Pii;
int main(){
	int n;
	while(scanf("%d",&n),n){
		bool flg[12800]={0};
		vector < int > numbers;
		map <int,int> cnt;
		reps(i,1,n){
			if(flg[(i*i)%n]++)continue;
			numbers.PB((i*i)%n);
		}
		int len = numbers.size();
		rep(i,len){
			rep(j,len){
				if(i == j)continue;
				int tmp = numbers[i]-numbers[j];
				if(tmp < 0)tmp += n;
				if(tmp > (n-1)/2)tmp = n-tmp;
				cnt[tmp]++;
			}
		}
		map <int,int> :: iterator it;
		for(it = cnt.begin(); it != cnt.end(); it++){
			cout << it->se << endl;
		}
	}
	return 0;
}