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;
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(long long x) {
  static const long long maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  long long len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (long long i = len - 1; i >= 0; --i) putchar(s[i]);
}
long long n;
long long a[551000];
long long f[551000];
long long val[551000];
long long T_val[551000];
const long long P = 1e9 + 7;
long long get_ny(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long g = get_ny(b, a % b, y, x);
  y -= x * (a / b);
  return g;
}
long long get_ny(long long v) {
  long long x, y;
  get_ny(v, P, x, y);
  return (x % P + P) % P;
}
long long NY[551000];
long long get_g(long long deep, long long len) {
  if (len >= 0)
    if (deep >= len) return val[deep] * NY[deep - len] % P;
  return 0;
}
long long get_pow(long long v, long long x) {
  if (x == 0) return 1;
  long long tmp = get_pow(v, x / 2);
  if (x % 2 == 0) return tmp * tmp % P;
  return tmp * tmp % P * v % P;
}
int tmp_V[10001][5001];
int main() {
  read(n);
  n--;
  for (long long i = 1; i <= n; i++) read(a[i]);
  reverse(a + 1, a + n + 1);
  val[0] = 1;
  for (long long i = 1; i <= n; i++) val[i] = val[i - 1] * a[i] % P;
  for (long long i = 0; i <= n; i++) NY[i] = get_ny(val[i]);
  long long NY_2 = get_ny(2);
  T_val[0] = 1;
  for (long long i = 1; i <= n; i++) T_val[i] = T_val[i - 1] * val[i] % P;
  for (int i = 0; i <= 2 * n; i++) {
    tmp_V[i][0] = 1ll * NY[0] * NY[i] % P;
    for (int j = 1; j <= i; j++)
      tmp_V[i][j] =
          ((tmp_V[i][j - 1] + 1ll * NY[j] * NY[i - j] % P) % P + P) % P;
  }
  for (long long i = 1; i <= n; i++) {
    long long sum = 0;
    for (long long j = 1; j <= 2 * i; j++) {
      f[j] = f[j] * a[i] % P;
      f[j] = (f[j] + a[i] * get_g(i - 1, j - 1) % P) % P;
      long long tmp = 0;
      tmp = a[i] * (a[i] - 1) % P * val[i - 1] % P * val[i - 1] % P;
      int L = i - 1 - min(min((j - 2) / 2, j - 2), i - 1);
      int R = (i - 1) - max(j - i - 1, 0ll);
      if (R >= L) {
        f[j] = (f[j] +
                tmp *
                    (1ll * tmp_V[2 * i - j][R] -
                     1ll * tmp_V[2 * i - j][max(L - 1, 0)]) %
                    P +
                P) %
               P;
        if (L == 0) f[j] = (f[j] + tmp * NY[0] % P * NY[2 * i - j] % P + P) % P;
      }
      if (j % 2 == 0)
        f[j] = (f[j] -
                tmp * NY_2 % P * NY[i - 1 - (j - 2) / 2] % P *
                    NY[i - 1 - ((j - 2) / 2)] % P +
                P) %
               P;
    }
  }
  for (long long i = 1; i <= n * 2; i++) printf("%I64d ", f[i]);
  puts("");
  return 0;
}