SaMer has written the greatest test case of all time for one of his problems. For a given array of integers, the problem asks to find the minimum number of groups the array can be divided into, such that the product of any pair of integers in the same group is a perfect square. 

Each integer must be in exactly one group. However, integers in a group do not necessarily have to be contiguous in the array.

SaMer wishes to create more cases from the test case he already has. His test case has an array A of n integers, and he needs to find the number of contiguous subarrays of A that have an answer to the problem equal to k for each integer k between 1 and n (inclusive).

Input

The first line of input contains a single integer n (1 ≤ n ≤ 5000), the size of the array.

The second line contains n integers a_1,a_2,...,a_n (-10^8 ≤ a_i ≤ 10^8), the values of the array.

Output

Output n space-separated integers, the k-th integer should be the number of contiguous subarrays of A that have an answer to the problem equal to k.

Examples

Input

2
5 5


Output

3 0


Input

5
5 -4 2 1 8


Output

5 5 3 2 0


Input

1
0


Output

1
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class CFA {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    private static final long MOD = 1000L * 1000L * 1000L + 7;
    private static final int[] dx = {0, -1, 0, 1};
    private static final int[] dy = {1, 0, -1, 0};
    private static final String yes = "Yes";
    private static final String no = "No";

    void solve() throws IOException {
        int n = nextInt();
        int[] arr = nextIntArr(n);
        int[] res = new int[n];
        int[] fact = new int[n];
        for (int i = 0; i < n; i++) {
            fact[i] = factor(arr[i]);
        }
        int[] copy = Arrays.copyOf(fact, fact.length);
        shuffle(copy);
        Arrays.sort(copy);
        int start = 0;
        int inc = 0;
        Map<Integer, Integer> hm = new HashMap<>();
        while (start < n) {
            int end = start;
            hm.put(copy[start], inc);
            inc++;
            while (end < n && copy[end] == copy[start]) {
                end++;
            }

            start = end;
        }

        boolean[] vis = new boolean[n];
        for (int i = 0; i < n; i++) {
            Arrays.fill(vis, false);
            int cnt = 0;
            boolean allZero = true;
            for (int j = i; j < n; j++) {
                if (fact[j] != 0) {
                    allZero = false;
                    int idx = hm.get(fact[j]);
                    if (!vis[idx]) {
                        vis[idx] = true;
                        cnt++;
                    }
                }

                if (allZero) {
                    res[0]++;
                }
                else {
                    res[cnt - 1]++;
                }
            }
        }

        for (int i = 0; i < n; i++) {
            out(res[i] + " ");
        }
    }

    int factor(int N) {
        if (N == 0) {
            return 0;
        }
        boolean isNeg = N < 0;
        N = Math.abs(N);
        int res = 1;
        for (int i = 2; i * i <= N; i++) {
            while (N % i == 0) {
                if (res % i == 0) {
                    res = res / i;
                }
                else {
                    res = res * i;
                }
                N = N / i;
            }
        }
        if (N != 1L) {
            if (res % N == 0) {
                res = res / N;
            }
            else {
                res = res * N;
            }
        }

        return isNeg ? -res : res;
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }

    long gcd(long a, long b) {
        while(a != 0 && b != 0) {
            long c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public CFA() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFA();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}