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 Temp {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	public static class pair implements Comparable<pair> {
		int val, ind;

		pair(int a, int b) {
			val = a;
			ind = b;
		}

		@Override
		public int compareTo(pair o) {
			return this.val == o.val ? this.ind - o.ind : this.val - o.val;
		}
	}

	void solve() {
		int n = nextInt();
		int[] arr = new int[n];
		pair[] copy = new pair[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextInt();
			for (int j = 2; j * j <= Math.abs(arr[i]); j++) {
				while (arr[i] % (j * j) == 0) {
					arr[i] /= (j * j);
				}
			}
		}

		for (int i = 0; i < n; i++) {
			copy[i] = new pair(arr[i], i);
		}
		Arrays.sort(copy);
		int[] a = new int[n];
		a[copy[0].ind] = 0;
		for (int i = 1, j = 0; i < n; i++) {
			if (copy[i - 1].val != copy[i].val) {
				j++;
			}
			a[copy[i].ind] = j;
		}

		int[] ans = new int[n + 1];

		for (int i = 0; i < n; i++) {
			boolean[] f = new boolean[n];
			int z = 0, k = 0;
			for (int j = i; j < n; j++) {
				if (arr[j] == 0) {
					z++;
				} else if (!f[a[j]]) {
					f[a[j]] = true;
					k++;
				}
				ans[z == 0 ? k : Math.max(1, k)]++;
			}
		}

		for (int i = 1; i <= n; i++) {
			out.print(ans[i] + " ");
		}
		out.println();
	}

	void run() throws Exception {
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + " ms");
	}

	public static void main(String[] args) throws Exception {
		new Temp().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private double nextDouble() {
		return Double.parseDouble(next());
	}

	private char nextChar() {
		return (char) skip();
	}

	private String next() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] next(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nextMatrix(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = next(m);
		return map;
	}

	private int[] nextArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	private int nextInt() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nextLong() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
}
