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
#include <bits/stdc++.h>
using namespace std;
void amax(long long &a, long long b) { a = max(a, b); }
void amin(long long &a, long long b) { a = min(a, b); }
const long long INF = 5e18;
const long double pi = 3.14159265358979323846;
struct number_theory {
  vector<long long> primelist;
  bool __primes_generated__ = 0;
  bool prime[100000001];
  void init(long long n = 600001) { genprimes(n); }
  long long gcd(long long first, long long second) {
    if (first == 0) return second;
    if (second == 0) return first;
    return gcd(second, first % second);
  }
  bool isprime(long long n) {
    if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (long long i = 5; i * i <= n; i += 6)
      if (n % i == 0 || n % (i + 2) == 0) return false;
    return true;
  }
  void sieve(long long n) {
    for (long long i = 0; i <= n; i++) prime[i] = 1;
    for (long long p = 2; p * p <= n; p++) {
      if (prime[p] == true) {
        for (long long i = p * p; i <= n; i += p) prime[i] = false;
      }
    }
    prime[1] = prime[0] = 0;
  }
  void genprimes(long long n) {
    __primes_generated__ = 1;
    sieve(n + 1);
    for (long long i = 2; i <= n; i++)
      if (prime[i]) primelist.push_back(i);
  }
  vector<pair<long long, long long> > factors(long long n) {
    if (!__primes_generated__) {
      cerr << "Call init you dope" << '\n';
      exit(1);
    }
    vector<pair<long long, long long> > facs;
    for (long long i = 0;
         primelist[i] * primelist[i] <= n && i < primelist.size(); i++) {
      if (n % primelist[i] == 0) {
        while (n % primelist[i] == 0) {
          n /= primelist[i];
          if (facs.size() == 0 || facs.back().first != primelist[i])
            facs.push_back(make_pair(primelist[i], 1));
          else
            facs.back().second++;
        }
      }
    }
    if (n > 1) facs.push_back(make_pair(n, 1));
    sort(facs.begin(), facs.end());
    return facs;
  }
  vector<long long> getdivs(long long n) {
    vector<long long> divs;
    for (long long i = 1; i * i <= n; i++) {
      if (n % i == 0) {
        divs.push_back(i);
        divs.push_back(n / i);
      }
    }
    {
      sort(divs.begin(), divs.end());
      divs.erase(unique(divs.begin(), divs.end()), divs.end());
    };
    return divs;
  }
};
number_theory nt;
long long getline(long long k) {
  if (k == 0) return k;
  long long curr = 1;
  vector<pair<long long, long long> > f = nt.factors(abs(k));
  for (pair<long long, long long> fac : f) {
    if (fac.second % 2) curr *= fac.first;
  }
  if (k < 0) return -curr;
  return curr;
}
long long get(long long k) {
  if (k == 0) return k;
  long long neg = (k < 0);
  k = abs(k);
  long long num = 1;
  long long storek = k;
  for (long long i = 2; i * i <= storek; i++) {
    long long ct = 0;
    while (k % i == 0) {
      ct++;
      k /= i;
    }
    if (ct % 2) num *= i;
  }
  num *= k;
  num *= (neg == 1 ? -1 : 1);
  return num;
}
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  map<long long, long long> m;
  long long ind = 1;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = get(a[i]);
    if (a[i] && !m[a[i]]) m[a[i]] = ind++;
    a[i] = m[a[i]];
  }
  long long freq[n + 1], ans[n + 1];
  memset(ans, 0, sizeof(ans));
  for (long long i = 0; i < n; i++) {
    memset(freq, 0, sizeof(freq));
    long long cntz = 0, dis = 0;
    for (long long j = i; j < n; j++) {
      freq[a[j]]++;
      if (freq[a[j]] == 1) {
        dis++;
        if (a[j] == 0) {
          cntz++;
          dis--;
        }
      }
      long long curr = dis;
      if (curr == 0) curr = (cntz > 0);
      ans[curr]++;
    }
  }
  for (long long i = 1; i < n + 1; i++) cout << ans[i] << " ";
  cout << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
