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;
using vint = vector<long long>;
using pint = pair<long long, long long>;
using vpint = vector<pint>;
template <typename A, typename B>
inline void chmin(A& a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A& a, B b) {
  if (a < b) a = b;
}
template <class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>& p) {
  ost << "{" << p.first << "," << p.second << "}";
  return ost;
}
template <class T>
ostream& operator<<(ostream& ost, const vector<T>& v) {
  ost << "{";
  for (long long i = 0; i < v.size(); i++) {
    if (i) ost << ",";
    ost << v[i];
  }
  ost << "}";
  return ost;
}
inline long long topbit(unsigned long long x) {
  return x ? 63 - __builtin_clzll(x) : -1;
}
inline long long popcount(unsigned long long x) {
  return __builtin_popcountll(x);
}
inline long long parity(unsigned long long x) { return __builtin_parity(x); }
template <uint32_t mod>
struct ModInt {
  uint32_t a;
  ModInt& s(uint32_t vv) {
    a = vv < mod ? vv : vv - mod;
    return *this;
  }
  ModInt(int64_t x = 0) { s(x % mod + mod); }
  ModInt& operator+=(const ModInt& x) { return s(a + x.a); }
  ModInt& operator-=(const ModInt& x) { return s(a + mod - x.a); }
  ModInt& operator*=(const ModInt& x) {
    a = uint64_t(a) * x.a % mod;
    return *this;
  }
  ModInt& operator/=(const ModInt& x) {
    *this *= x.inv();
    return *this;
  }
  ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
  ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
  ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
  ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
  bool operator==(const ModInt& x) const { return a == x.a; }
  bool operator!=(const ModInt& x) const { return a != x.a; }
  bool operator<(const ModInt& x) const { return a < x.a; }
  ModInt operator-() const { return ModInt() - *this; }
  ModInt pow(int64_t n) const {
    ModInt res(1), x(*this);
    while (n) {
      if (n & 1) res *= x;
      x *= x;
      n >>= 1;
    }
    return res;
  }
  ModInt inv() const { return pow(mod - 2); }
};
template <uint32_t mod>
istream& operator>>(istream& in, ModInt<mod>& a) {
  return (in >> a.a);
}
template <uint32_t mod>
ostream& operator<<(ostream& out, const ModInt<mod>& a) {
  return (out << a.a);
}
using mint = ModInt<1000000007>;
long long N;
long long A[5555];
mint f[2][5010], f2[2][10010];
mint ans[10010];
signed main() {
  cin >> N;
  for (long long i = 0; i < (N - 1); i++) cin >> A[i];
  f[(N - 1) & 1][0] = 1;
  f2[(N - 1) & 1][0] = 1;
  for (long long i = N - 2; i >= 0; i--) {
    for (long long j = 1; j <= 2 * (N - 1); j++) {
      ans[j] *= A[i];
    }
    const long long bi = A[i] * (A[i] - 1) / 2;
    for (long long j = 2; j <= 2 * (N - 1); j++) {
      ans[j] += f2[(i + 1) & 1][j - 2] * bi;
    }
    for (long long j = 1; j <= N - 1; j++) {
      ans[j] += f[(i + 1) & 1][j - 1] * A[i];
    }
    for (long long j = 1; j <= N - 1; j++) {
      f[i & 1][j] = f[(i + 1) & 1][j - 1] * A[i];
    }
    f[i & 1][0] = 1;
    f2[i & 1][0] = 1;
    for (long long j = 1; j <= N - 1; j++) {
      f2[i & 1][j] += f[(i + 1) & 1][j - 1] * A[i] * 2;
    }
    for (long long j = 2; j <= 2 * (N - 1); j++) {
      f2[i & 1][j] += f2[(i + 1) & 1][j - 2] * A[i] * A[i];
    }
    for (long long j = 0; j <= N - 1; j++) f[(i + 1) & 1][j] = 0;
    for (long long j = 0; j <= 2 * (N - 1); j++) f2[(i + 1) & 1][j] = 0;
  }
  for (long long i = 1; i <= 2 * (N - 1); i++) {
    if (i != 1) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  return 0;
}