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.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;

public class D {

	/*
5
5 -4 2 -1 8


12 3
12 12
12 27
12 48
12 75
	 */
	static int N;
	static long ar[];
	static long res[];
	static boolean canInc[][];
	
	public static void main(String[] args) {
		JS in = new JS();
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		ar = new long[N];
		res = new long[N+1];
		canInc = new boolean[N][N];
		for(int i = 0; i < N; i++) ar[i] = in.nextLong();
		for(int i = 0; i < N; i++) {	//val we trying to inc
			boolean found = false;
			for(int j = i-1; j >= 0; j--) {
				if(val(ar[i], ar[j])) {
					found = true;
				}
				if(found) canInc[j][i] = true;
			}
		}
		for(int i = 0; i < N; i++) {
			int curGroups = 1;
			res[curGroups]++;
			int zeros = ar[i] == 0 ? 1 : 0;
			for(int j = i+1; j < N; j++) {
				if(ar[j] == 0) zeros++;
				if(!canInc[i][j]) {
					if(zeros == 0)curGroups++;
					else zeros--;
				}
				res[curGroups]++;
			}
		}	
		
		for(int i = 1; i <= N; i++) out.print(res[i]+" ");
		out.println();
		out.close();
	}
	
	static boolean val(long a, long b) {
		long res = a*b;
		//if(res==0)return true;
		if(res <= 0) return false;
		long sqrt = (long) Math.sqrt(res);
		if(sqrt*sqrt == res) return true;
		return false;
	}

	
	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;
		
		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}
		
		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}
		
		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}				
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}
		
		public int nextInt() {
			return (int)nextLong();
		}
		
		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}
		
		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}
		
		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}
		
		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
	
}
