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 CPP):

Solution:
#include <bits/stdc++.h>
template <typename T>
void read(T& re) {
  re = 0;
  char ch = '!';
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    re = re * 10 + ch - '0';
    ch = getchar();
  }
}
template <typename T, typename... Args>
void read(T& re, Args&... args) {
  read(re);
  read(args...);
}
template <typename T>
void write(T A) {
  if (A < 0) {
    A = -A;
    putchar('-');
  }
  if (A / 10) write(A / 10);
  putchar(A % 10 + '0');
}
const int MAXN = 5000 + 7, mod = 1e9 + 7;
int power(int A, int B) {
  int C = 1;
  while (B) {
    if (B & 1) C = C * (long long)A % mod;
    A = A * (long long)A % mod;
    B >>= 1;
  }
  return C;
}
int n;
int a[MAXN];
int down[MAXN][MAXN << 1], up[2][MAXN << 1], siz[MAXN];
int sum[MAXN << 1];
int main() {
  read(n);
  siz[1] = 1;
  for (int i = 1; i < n; i++) {
    read(a[i]);
    siz[i + 1] = siz[i] * (long long)a[i] % mod;
  }
  for (int i = n; i >= 1; i--) {
    down[i][0] = 1;
    for (int j = 1; j + i <= n; j++) {
      down[i][j] = down[i + 1][j - 1] * (long long)a[i] % mod;
      sum[j] = (sum[j] + siz[i] * (long long)down[i][j] % mod) % mod;
    }
  }
  up[0][0] = 1;
  for (int i = 2; i <= n; i++) {
    up[1][0] = 1;
    for (int j = 1; j <= i + n - 2; j++) {
      if (i > 1) up[1][j] = (up[1][j] + (long long)up[0][j - 1]) % mod;
      if (i > 1 && j >= 2)
        up[1][j] =
            ((up[1][j] + (long long)down[i - 1][j - 1] - down[i][j - 2]) % mod +
             mod) %
            mod;
      sum[j] = (sum[j] + siz[i] * (long long)up[1][j] % mod) % mod;
    }
    for (int j = 1; j <= i + n - 2; j++) {
      up[0][j] = up[1][j];
      up[1][j] = 0;
    }
  }
  for (int i = 1; i <= n + n - 2; i++) {
    write(sum[i] * (long long)((mod + 1) / 2) % mod);
    putchar(' ');
  }
}