Problem: You are given a rooted tree. Let's denote d(x) as depth of node x: depth of the root is 1, depth of any other node x is d(y) + 1, where y is a parent of x.

The tree has the following property: every node x with d(x) = i has exactly ai children. Maximum possible depth of a node is n, and an = 0.

We define fk as the number of unordered pairs of vertices in the tree such that the number of edges on the simple path between them is equal to k.

Calculate fk modulo 109 + 7 for every 1 ≤ k ≤ 2n - 2.

Input

The first line of input contains an integer n (2 ≤ n ≤ 5 000) — the maximum depth of a node.

The second line of input contains n - 1 integers a1, a2, ..., an - 1 (2 ≤ ai ≤ 109), where ai is the number of children of every node x such that d(x) = i. Since an = 0, it is not given in the input.

Output

Print 2n - 2 numbers. The k-th of these numbers must be equal to fk modulo 109 + 7.

Examples

Input

4
2 2 2


Output

14 19 20 20 16 16 

Input

3
2 3


Output

8 13 6 9 

Note

This the tree from the first sample: 

<image>

Solution (in JAVA):

Solution:
// practice with rainboy
// https://codeforces.com/blog/entry/58519
import java.io.*;
import java.util.*;

public class CF954H extends PrintWriter {
	CF954H() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF954H o = new CF954H(); o.main(); o.flush();
	}

	static final int MD = 1000000007, INV2 = 500000004;
	int d_, x_, y_;
	void gcd_(int a, int b) {
		if (b == 0) {
			d_ = a; x_ = 1; y_ = 0;
		} else {
			gcd_(b, a % b);
			int t = x_ - a / b * y_; x_ = y_; y_ = t;
		}
	}
	int inv(int a) {
		gcd_(a, MD);
		return x_;
	}
	void main() {
		int n = sc.nextInt();
		int[] aa = new int[n - 1];
		for (int h = 0; h < n - 1; h++)
			aa[h] = sc.nextInt();
		int[] pp = new int[n], pp_ = new int[n];
		pp[n - 1] = pp_[n - 1] = 1;
		for (int h = n - 2; h >= 0; h--)
			pp_[h] = inv(pp[h] = (int) ((long) aa[h] * pp[h + 1] % MD));
		int[][] qq = new int[n][n * 2];
		for (int h = 0; h < n; h++)
			qq[h][0] = 1;
		for (int k = 1; k < n * 2; k++)
			for (int h = 1; h < n; h++) {
				long x = qq[h - 1][k - 1];
				if (k >= 2 && h + k - 2 < n) {
					long p = (long) pp[h] * pp_[h + k - 2] % MD;
					x = (x + (aa[h - 1] - 1) * p) % MD;
				}
				qq[h][k] = (int) x;
			}
		for (int k = 1; k < n * 2 - 1; k++) {
			long x = 0;
			for (int h = 0; h < n; h++) {
				long cnt = (long) pp[0] * pp_[h] % MD;
				long p = h + k < n ? (long) pp[h] * pp_[h + k] % MD : 0;
				long q = qq[h][k];
				x = (x + (long) cnt * (p + q)) % MD;
			}
			x = x * INV2 % MD;
			if (x < 0)
				x += MD;
			print(x + " ");
		}
		println();
	}
}