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>
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <long long MOD>
class ModInt {
 public:
  static long long pw(long long a, long long b) {
    long long ans = 1;
    while (b) {
      while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
      ans = (ans * a) % MOD, --b;
    }
    return ans;
  }
  long long x;
  ModInt() : x(0) {}
  ModInt(long long x) : x(x % MOD) {}
  ModInt operator+(ModInt b) {
    ModInt ans;
    ans.x = x + b.x;
    if (ans.x >= MOD) ans.x -= MOD;
    return ans;
  }
  ModInt &operator+=(ModInt b) {
    x += b.x;
    if (x >= MOD) x -= MOD;
    return *this;
  }
  ModInt operator-(ModInt b) {
    ModInt ans;
    ans.x = x - b.x;
    if (ans.x < 0) ans.x += MOD;
    return ans;
  }
  ModInt &operator-=(ModInt b) {
    x -= b.x;
    if (x < 0) x += MOD;
    return *this;
  }
  ModInt operator-() {
    ModInt ans;
    if (x == 0) return ans;
    ans.x = MOD - x;
    return ans;
  }
  ModInt operator*(ModInt b) { return ModInt(x * b.x); }
  ModInt &operator*=(ModInt b) {
    x = (x * b.x) % MOD;
    return *this;
  }
  ModInt inv() {
    if (MOD >= 2) return ModInt(pw(x, MOD - 2));
    return ModInt();
  }
  ModInt operator/(ModInt b) { return ModInt(x * b.inv().x); }
  ModInt &operator/=(ModInt b) {
    x = (x * b.inv().x) % MOD;
    return *this;
  }
  bool operator==(ModInt b) { return x == b.x; }
  bool operator!=(ModInt b) { return x != b.x; }
};
using num = ModInt<MOD>;
const int MAXN = 12000;
int n;
long long a[MAXN];
num ans[MAXN];
num now[MAXN];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  --n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  num cnt = 1;
  num B2 = num(2).inv();
  for (int i = 0; i <= n; ++i) {
    num cur = cnt;
    now[0] += cur;
    for (int j = i - 1; j >= 0; --j) {
      now[(i - j) * 2] += cur * (a[j] - 1);
      ans[(i - j) * 2] += cur * (a[j] - 1) * B2;
      cur *= a[j];
    }
    for (int j = 2 * n; j > 0; --j) now[j] = now[j - 1] * a[i];
    now[0] = 0;
    for (int i = 0; i <= 2 * n; ++i) ans[i] += now[i];
    cnt *= a[i];
  }
  for (int i = 1; i <= 2 * n; ++i) cout << ans[i].x << " ";
  cout << "\n";
  return 0;
}
