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>
template <typename T>
void MACRO_VAR_Scan(T& t) {
  std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First& first, Rest&... rest) {
  std::cin >> first;
  MACRO_VAR_Scan(rest...);
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T& t) {
  t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First& first, Rest&... rest) {
  first.resize(n);
  MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T& t) {
  std::cin >> t[p];
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First& first, Rest&... rest) {
  std::cin >> first[p];
  MACRO_VEC_ROW_Scan(p, rest...);
}
template <typename T>
inline T CHMAX(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <typename T>
inline T CHMIN(T& a, const T b) {
  return a = (a > b) ? b : a;
}
void CHECKTIME(std::function<void()> f) {
  auto start = std::chrono::system_clock::now();
  f();
  auto end = std::chrono::system_clock::now();
  auto res = std::chrono::duration_cast<std::chrono::nanoseconds>((end - start))
                 .count();
  std::cerr << "[Time:" << res << "ns  (" << res / (1.0e9) << "s)]\n";
}
template <class T>
std::vector<std::vector<T>> VV(int n) {
  return std::vector<std::vector<T>>(n);
}
template <class T>
std::vector<std::vector<T>> VV(int n, int m, T init = T()) {
  return std::vector<std::vector<T>>(n, std::vector<T>(m, init));
}
template <typename S, typename T>
std::ostream& operator<<(std::ostream& os, std::pair<S, T> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using PAIR = std::pair<int, int>;
using PAIRLL = std::pair<ll, ll>;
constexpr int INFINT = 1 << 30;
constexpr int INFINT_LIM = (1LL << 31) - 1;
constexpr ll INFLL = 1LL << 60;
constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62);
constexpr double EPS = 1e-9;
constexpr int MOD = 1000000007;
constexpr double PI = 3.141592653589793238462643383279;
template <class T, size_t N>
void FILL(T (&a)[N], const T& val) {
  for (auto& x : a) x = val;
}
template <class ARY, size_t N, size_t M, class T>
void FILL(ARY (&a)[N][M], const T& val) {
  for (auto& b : a) FILL(b, val);
}
template <class T>
void FILL(std::vector<T>& a, const T& val) {
  for (auto& x : a) x = val;
}
template <class ARY, class T>
void FILL(std::vector<std::vector<ARY>>& a, const T& val) {
  for (auto& b : a) FILL(b, val);
}
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  ;
  int n;
  MACRO_VAR_Scan(n);
  ;
  std::vector<int> d(n - 1);
  for (auto& i : d) std::cin >> i;
  ;
  std::reverse((d).begin(), (d).end());
  std::vector<int> ans(n + n - 1, 0), dp(n, 0), dp2(n + n - 2, 0);
  ans[0] = dp[0] = 1;
  for (int i = 0; i < int(n - 1); ++i) {
    if (i > 0) {
      int dd = (ll)d[i - 1] * d[i - 1] % MOD;
      for (int j = 0; j < int(2 * i - 1); ++j) dp2[j] = (ll)dp2[j] * dd % MOD;
      for (int j = 0; j < int(i); ++j)
        dp2[j + i] = ((ll)dp2[j + i] + 2 * dp[j]) % MOD;
    }
    dp2[2 * i] = 1;
    for (int j = 0; j < int(i + 1); ++j) dp[j] = (ll)dp[j] * d[i] % MOD;
    dp[i + 1] = 1;
    for (int j = 0; j < int(2 * i + 3); ++j) ans[j] = (ll)ans[j] * d[i] % MOD;
    for (int j = 0; j < int(i + 2); ++j)
      ans[j] = (ans[j] + dp[i + 1 - j]) % MOD;
    int dd = (ll)d[i] * (d[i] - 1) / 2 % MOD;
    for (int j = 0; j < int(2 * i + 1); ++j)
      ans[j + 2] = (ans[j + 2] + (ll)dd * dp2[2 * i - j]) % MOD;
  }
  for (int i = (1); i < (n + n - 1); ++i) {
    std::cout << ans[i];
    std::cout << (i + 1 == n + n - 1 ? '\n' : ' ');
    ;
  }
  return 0;
}
