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>
using namespace std;
const int SIZE = 1 << 10;
int pointer = SIZE;
char buffer[SIZE];
char Advance() {
  if (pointer == SIZE) {
    fread(buffer, 1, SIZE, stdin);
    pointer = 0;
  }
  return buffer[pointer++];
}
int Read() {
  int answer = 0;
  char ch = Advance();
  while (!isdigit(ch)) ch = Advance();
  while (isdigit(ch)) {
    answer = answer * 10 + ch - '0';
    ch = Advance();
  }
  return answer;
}
const int MAXN = 5000;
const long long MOD = 1000000007;
void Add(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void Subtract(int &x, int y) {
  x -= y;
  if (x < 0) x += MOD;
}
int factorial[1 + MAXN], inverse[1 + MAXN];
int RaiseToPower(int base, int power) {
  int answer = 1;
  while (power) {
    if (power % 2) answer = (1LL * answer * base) % MOD;
    base = (1LL * base * base) % MOD;
    power /= 2;
  }
  return answer;
}
int Combinations2(int n) {
  if (n % 2 == 0)
    return (1LL * (n / 2) * (n - 1)) % MOD;
  else
    return (1LL * n * ((n - 1) / 2)) % MOD;
}
int children[1 + MAXN], depth[1 + MAXN];
int answer[1 + 2 * MAXN], chains[1 + 2 * MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d", &children[i]);
  depth[1] = 1;
  for (int i = 2; i <= n; i++)
    depth[i] = (1LL * depth[i - 1] * children[i - 1]) % MOD;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      chains[i + j] = (1LL * depth[i] * depth[j] + chains[i + j]) % MOD;
  int multiplier = 1;
  for (int i = 1; i < n; i++) {
    int divide = RaiseToPower(children[i], MOD - 2);
    for (int j = i + 1; j <= n; j++) {
      int add = (1LL * multiplier * depth[j]) % MOD;
      Add(answer[j - i], add);
      Subtract(chains[j - i + 2], (2LL * depth[j] * depth[i]) % MOD);
      depth[j] = (1LL * depth[j] * divide) % MOD;
    }
    divide = (1LL * divide * divide) % MOD;
    for (int j = 2; j <= 2 * (n - i); j++) {
      chains[j] = (1LL * chains[j + 2] * divide) % MOD;
      int add = (1LL * chains[j] * Combinations2(children[i])) % MOD;
      add = (1LL * add * multiplier) % MOD;
      Add(answer[j], add);
    }
    multiplier = (1LL * multiplier * children[i]) % MOD;
  }
  for (int i = 1; i <= 2 * n - 2; i++) printf("%d ", answer[i]);
  return 0;
}