#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999

int main(){
    int n;
    while(cin>>n&&n){
        set<int> a;
        map<int,int> b;
        for(int i=1;i<n;i++){
            int tmp = 0;
            tmp = i*i;
            tmp %= n;
            a.insert(tmp);
        }
        
        
        vector<int> vec;
        for(int x : a) vec.pb(x);
        
        rep(i,vec.size()){
            rep(j,vec.size()){
                if(i==j)continue;
                int tmp = vec[i]-vec[j];
                while(1){
                    int m = tmp;
                    if(tmp<0)tmp+=n;
                    if(tmp>(n-1)/2)tmp = n-tmp;
                    if(m==tmp)break;
                }
//                cout<<tmp<<endl;
                b[tmp] = b[tmp]+1;
            }
        }
        for(pii x : b){
            cout<<x.second<<endl;
        }
    }
}