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.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.flush();out.close();
    }
        static class TaskE {
          ArrayList<Integer> prime=new ArrayList<>();
          void get_p(){
           int a[]=new int[10000];
           for(int i=2;i<10000;i++)a[i]=i;
           for(int i=2;i<10000;i+=2)a[i]=2;
           for(int i=3;i<10000;i+=2){
            for(int j=2*i;j<10000;j+=i){
             if(a[j]==j)a[j]=i;
            }
           }
           for(int i=2;i<10000;i++){
            if(a[i]==i)prime.add(i);
           }
          }
          int get(int x){
           if(x==0)return x;
           int r=1;boolean neg=false;
           if(x<0){neg=true;x=-x;}
           for(int i=0;i<prime.size();i++){
            int f=prime.get(i);
            int cnt=0;
            while(x%f==0){
             x/=f;++cnt;
            }if(cnt%2!=0)r*=f;
           }if(x!=0)r*=x; 
           return neg?-r:r;
          }
          public void solve(int testNumber, InputReader in, PrintWriter out) {
              int n=in.nextInt();get_p();
             // System.out.println(prime);
              int a[]=new int[n];
              int ans[]=new int[n+1];
              for(int i=0;i<n;i++)a[i]=get(in.nextInt());
              HashMap<Integer,Integer> hm=new HashMap<>();
              int N=0;
              for(int i=0;i<n;i++){
               if(a[i]==0)continue;
               if(!hm.containsKey(a[i]))hm.put(a[i],++N);
               a[i]=hm.get(a[i]);
              }
//              for(int i=0;i<n;i++)System.out.print(a[i]+" ");
              int cnt0=0;
              int f[]=new int[5010];
              for(int i=1;i<=n;i++){
              Arrays.fill(f,0);
              int cnt=0;
              for(int j=0;j<i;j++){
               if(a[j]==0){
                cnt0++;continue;
               }
               if(f[a[j]]==0){
                ++cnt;
               }f[a[j]]++;
              }
              
              if(cnt0!=0&&cnt<2)ans[1]++;
              else ans[cnt]++;
              
               for(int j=1;j<=n-i;j++){//System.out.println(ans[1]+" "+i+" "+j);
                if(a[j-1]==0){
                 cnt0--;
                }else{
                 if(f[a[j-1]]==1)--cnt;
                 f[a[j-1]]--;
                }
                if(a[j+i-1]==0){
                 cnt0++;
                }else{
                 if(f[a[j+i-1]]==0)++cnt;
                 ++f[a[j+i-1]];
                }
                if(cnt0!=0&&cnt<2)ans[1]++;
                else ans[cnt]++;
               }
              }
              for(int i=1;i<=n;i++){
               out.print(ans[i]+" ");
              }
          }
          
//        int[] radixSort(int[] f){ return radixSort(f, f.length); }
//	int[] radixSort(int[] f, int n)
//	{
//		int[] to = new int[n];
//		{
//			int[] b = new int[65537];
//			for(int i = 0;i < n;i++)b[1+(f[i]&0xffff)]++;
//			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
//			for(int i = 0;i < n;i++)to[b[f[i]&0xffff]++] = f[i];
//			int[] d = f; f = to;to = d;
//		}
//		{
//			int[] b = new int[65537];
//			for(int i = 0;i < n;i++)b[1+(f[i]>>>16)]++;
//			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
//			for(int i = 0;i < n;i++)to[b[f[i]>>>16]++] = f[i];
//			int[] d = f; f = to;to = d;
//		}
//		return f;
//	}
    }
    static class InputReader {
        BufferedReader br;
        StringTokenizer st;
        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}