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.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.List;
 import java.util.*;
public  class realfast implements Runnable 
  {
    private static final int INF = (int) 1e9;
    long in= (long)Math.pow(10,9)+7;
    long fac[]= new long[3000];
    public  void solve() throws IOException 
    {
        int n = readInt();
        int arr[]= new int[n];
        for(int i =0;i<n;i++)
        {
            arr[i]= readInt();
        }
        HashMap<Integer,Integer> map = new HashMap<>();
        int count=0;
        for(int i =0;i<n;i++)
        {
            boolean check=false;
            if(arr[i]>=0)
            {
                check=true;
            }
            int val = Math.abs(arr[i]);
            int root =(int) Math.pow(val,0.5);
            for(int j=2;j<=root;j++)
            {
                int cal = j*j;
                while(val%cal==0)
                {
                        val= val/cal;
                }

            }
            if(!check)
                val=-val;
             if(!map.containsKey(val))
             {
                count++;
                map.put(val,count);
             }
             if(val!=0)
            arr[i]=map.get(val);
             else
            arr[i]=0;
        }
        int ans[]= new int[n+1];
        //HashMap<Integer,Integer> map= new HashMap<>();
        for(int i=0;i<n;i++)
        {
            boolean map1[]= new boolean[n+1];
             count =0;
             int zero=0;
            for(int j=i;j<n;j++)
            {
                  if(arr[j]==0)
                    zero++;
                  else if(!map1[arr[j]])
                  {
                      count++;
                      map1[arr[j]]=true; 
                  }
                 if(count>=1)
                 ans[count]++;
                 else 
                 ans[1]++;
            }
        }
        for(int i=1;i<=n;i++)
            out.print(ans[i]+" ");



    }
    public int seg(int seg[], int left, int right, int index, int val)
    {
        if(left==right)
        {
            seg[index]=1;
            return 1;
        }
        int mid = left+(right-left)/2;

        if(val<=mid)
        {
            seg(seg,left,mid,2*index+1,val);
        }
        else
        {
            seg(seg,mid+1,right,2*index+2,val);
        }
        seg[index]= seg[2*index+1]+seg[2*index+2];
        return seg[index];
    }
    public int val(int seg[], int left , int right, int l , int r,int index)
    {
            if(left>r||right<l)
            {
               return 0;
            }
            int mid = left+(right-left)/2;
            if(left>=l&&right<=r)
            return seg[index];

            return val(seg,left,mid,l,r,2*index+1)+val(seg,mid+1,right,l,r,2*index+2);
    }
    public int gcd(int a , int b )
    {
      if(a<b)
      {
        int t =a;
        a=b;
        b=t;
      }
      if(a%b==0)
        return b ;
      return gcd(b,a%b);
    }
    public long pow(long n , long p,long m)
    {
         if(p==0)
            return 1;
        long val = pow(n,p/2,m);;
        val= (val*val)%m;
        if(p%2==0)
            return val;
        else
            return (val*n)%m;
    }
    
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public static void main(String[] args) {
        new Thread(null, new realfast(), "", 128 * (1L << 20)).start();
    }
 
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private PrintWriter out;
 
    @Override
    public void run() {
        try {
            if (ONLINE_JUDGE || !new File("input.txt").exists()) {
                reader = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                reader = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }
            solve();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                // nothing
            }
            out.close();
        }
    }
 
    private String readString() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
 
    @SuppressWarnings("unused")
    private int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
 
    @SuppressWarnings("unused")
    private long readLong() throws IOException {
        return Long.parseLong(readString());
    }
 
    @SuppressWarnings("unused")
    private double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }
}
class edge implements Comparable<edge>{
    int val ;
    int color;
    
    edge(int u, int v)
    {
       this.val=u;
       this.color=v;
    }
    public int compareTo(edge e)
    {
        return this.val-e.val;
    }
}