using System.Linq;
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        while (true)
        {
            var n = int.Parse(Console.ReadLine().Trim());
            if (n == 0) break;
            var n2 = (n - 1) / 2;
            var w1 = new List<int>();
            for (int i = 1; i < n; i++) w1.Add(i * i  % n);
            var w2 = w1.Distinct().ToArray();
            var ret = new int[n2];
            for (int i = 0; i < w2.Length; i++)
                for (int j = 0; j < w2.Length; j++)
                    if (i != j)
                    {
                        var z = w2[i] - w2[j];
                        if (z < 0) z += n;
                        if (z > n2) z = n - z;
                        ret[z-1]++; 
                    }
            foreach (var x in ret)
                Console.WriteLine(x);
        }
    }
}