2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
#pragma optimize("unroll-loops,no-stack-protector")
using namespace std;
namespace io {
struct eof {
  eof() {}
};
const int L = (1 << 21) | 5;
char ibuf[L], *iS, *iT, obuf[L], *oS = obuf, *oT = obuf + L - 1, c, qu[55];
int f, qr;
inline void flush() { fwrite(obuf, 1, oS - obuf, stdout), oS = obuf; }
inline void putc(char x) {
  *oS++ = x;
  if (oS == oT) flush();
}
template <class I>
inline void gi(I &x) {
  for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       (c < '0' || c > '9') && (c != EOF);
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-') f = -1;
  if (c == EOF) throw eof();
  for (x = 0; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = x * 10 + (c & 15);
  x *= f;
}
template <class I>
inline void print(I x) {
  if (!x) putc('0');
  if (x < 0) putc('-'), x = -x;
  while (x) qu[++qr] = x % 10 + '0', x /= 10;
  while (qr) putc(qu[qr--]);
}
inline void ps(const char *s) {
  int l = strlen(s), x;
  for (x = 0; x < l; x++) putc(s[x]);
}
struct IOC {
  ~IOC() { flush(); }
} ioc;
inline double readld() {
  double x = 0, y = 1;
  for (c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-') y = -1;
  assert(c != '.');
  for (; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = x * 10 + (c & 15);
  x *= y;
  assert(c != 'e');
  if (c == '.')
    for (c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                         (iS == iT ? EOF : *iS++))
                       : *iS++);
         c <= '9' && c >= '0';
         c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                         (iS == iT ? EOF : *iS++))
                       : *iS++))
      y *= 0.1, x += y * (c & 15);
  return x;
}
inline void printld(double x, int y) {
  if (x < 0) putc('-'), x = -x;
  x += .5 * pow(.1, y);
  print((unsigned long long)x), putc('.');
  for (x -= (unsigned long long)x; y; --y)
    x *= 10, putc((int)x + '0'), x -= (int)x;
}
}  // namespace io
using io::gi;
using io::print;
using io::putc;
template <class T>
int ctz(T a) {
  return sizeof(T) > 4 ? __builtin_ctzll(a) : __builtin_ctz(a);
}
template <class T>
inline T gcd(T a, T b) {
  int shift = ctz(a | b);
  for (b >>= ctz(b), a >>= ctz(a); a; a -= b, a >>= ctz(a))
    if (a < b) swap(a, b);
  return b << shift;
}
template <class T>
void exgcd(T a, T b, T &x, T &y) {
  if (!b) return (void)(x = 1, y = 0);
  exgcd(b, a % b, y, x), y -= a / b * x;
}
template <class T>
T Inv(T a, T p) {
  T x, y;
  exgcd(a, p, x, y);
  return (x % p + p) % p;
}
inline int fpow(int a, int t, int p) {
  static int r;
  for (r = 1; t; a = (long long)a * a % p, t >>= 1)
    if (t & 1) r = (long long)r * a % p;
  return r;
}
string to_string(string s) { return '"' + s + '"'; };
string to_string(const char *s) { return to_string(string(s)); }
string to_string(bool f) { return f ? "true" : "false"; }
template <class A, class B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <class T>
string to_string(T v) {
  string s = "{", e = "";
  for (auto &x : v) s += e + to_string(x), e = ", ";
  s += "}";
  return s;
}
void debug_out() { cerr << endl; }
template <class A, class... B>
void debug_out(A x, B... y) {
  cerr << " " << to_string(x), debug_out(y...);
}
void scan() {}
template <class A, class... B>
void scan(A &a, B &...b) {
  gi(a), scan(b...);
}
template <class T>
void read(T first, T last) {
  for (; first != last; ++first) gi(*first);
}
template <class T>
void write(T first, T last) {
  for (; first != last; putc(++first == last ? '\n' : ' ')) print(*first);
}
template <class T>
void show(T x) {
  print(x), putc('\n');
}
template <class A, class... B>
void show(A a, B... b) {
  print(a), putc(' '), show(b...);
}
template <class T>
inline bool chkmin(T &a, T b) {
  return b < a ? a = b, true : false;
}
template <class T>
inline bool chkmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
template <class T>
inline T abs(T x) {
  return x < 0 ? -x : x;
}
const int P = 1e9 + 7, mod = P;
inline void inc(int &x, int y) {
  x += y;
  x < P ?: x -= P;
}
inline void inc(int &x, unsigned long long y) { x = (x + y) % P; }
inline void minus_down(int &x, int y) {
  x -= y;
  x >= 0 ?: x += P;
}
inline void minus_down(int &x, unsigned long long y) {
  x -= y % P;
  x >= 0 ?: x += P;
}
inline int add(int x, int y) { return (x += y) < mod ? x : x - mod; }
inline int sub(int x, int y) { return (x -= y) < 0 ? x + mod : x; }
inline int mul(int x, int y) { return long long(x) * y % mod; }
inline void addx(int &x, int y) { (x += y) < mod ?: x -= mod; }
inline void subx(int &x, int y) { (x -= y) >= 0 ?: x += mod; }
template <class T>
inline int sgn(T x) {
  return (x > 0) - (x < 0);
}
inline int fpow(int a, long long t) {
  static const int fmod = mod - 1;
  t %= fmod;
  if (t < 0) t += fmod;
  int r;
  for (r = 1; t; t >>= 1, a = mul(a, a))
    if (t & 1) r = mul(r, a);
  return r;
}
const int N = 1e5 + 5, M = 1e5;
const long double PI = acos(-1);
int n, x[N];
unsigned long long inv, pinv;
struct _ {
  unsigned long long t[5];
  _() { memset(t, 0, sizeof(t)); }
  unsigned long long &operator[](int x) { return t[x]; }
  friend _ operator+(_ a, _ b) {
    _ c;
    for (int i = 0; i < 5; ++i) c.t[i] = a.t[i] + b.t[i];
    return c;
  }
  friend _ operator-(_ a, _ b) {
    _ c;
    for (int i = 0; i < 5; ++i) c.t[i] = a.t[i] - b.t[i];
    return c;
  }
  _ move(int l) {
    _ c;
    for (int i = 0; i < 5; ++i) c.t[(i + l) % 5] = t[i];
    return c;
  }
  friend _ operator*(_ a, _ b) {
    _ c;
    int i, j;
    for (i = 0; i < 5; ++i)
      for (j = 0; j < 5; ++j) c[(i + j) % 5] += a[i] * b[j];
    return c;
  }
  unsigned long long get() {
    t[1] += t[4], t[2] += t[3];
    long double res = 0;
    res += t[1] * cosl(2 * PI / 5 * 1);
    res += t[2] * cosl(2 * PI / 5 * 2);
    return unsigned long long(res + 0.5) + t[0];
  }
} f[N], tmp[20];
void dft(_ *arr, int len) {
  if (len == 1) return;
  int i, j, k, l = len / 10, w;
  for (i = 0; i < len; i += l) {
    dft(arr + i, len / 10);
  }
  for (j = 0; j < l; ++j) {
    for (i = 0; i < 10; ++i) {
      tmp[i] = _();
      for (k = 0; k < 10; ++k) {
        w = i * k % 10;
        if (~w & 1) {
          tmp[i] = tmp[i] + arr[k * l + j].move(w >> 1);
        } else {
          tmp[i] = tmp[i] - arr[k * l + j].move(((w + 5) >> 1) % 5);
        }
      }
    }
    for (i = 0; i < 10; ++i) {
      arr[i * l + j] = tmp[i];
    }
  }
}
void idft(_ *arr, int len) {
  if (len == 1) return;
  int i, j, k, l = len / 10, w;
  for (i = 0; i < len; i += l) {
    idft(arr + i, len / 10);
  }
  for (j = 0; j < l; ++j) {
    for (i = 0; i < 10; ++i) {
      tmp[i] = _();
      for (k = 0; k < 10; ++k) {
        w = i * k % 10;
        w = (10 - w) % 10;
        if (~w & 1) {
          tmp[i] = tmp[i] + arr[k * l + j].move(w >> 1);
        } else {
          tmp[i] = tmp[i] - arr[k * l + j].move(((w + 5) >> 1) % 5);
        }
      }
    }
    for (i = 0; i < 10; ++i) {
      arr[i * l + j] = tmp[i];
    }
  }
}
_ pow(_ x, int n) {
  if (n == 1) return x;
  _ t = pow(x, n >> 1);
  t = t * t;
  if (n & 1) t = t * x;
  return t;
}
int main() {
  int i;
  pinv = 5, inv = 1;
  for (int t = 0; t < 63; ++t) inv *= pinv, pinv *= pinv;
  inv = inv * inv * inv * inv * inv;
  scan(n);
  read(x + 1, x + n + 1);
  for (i = 1; i <= n; ++i) ++f[x[i]][0];
  dft(f, M);
  for (i = 0; i < M; ++i) f[i] = pow(f[i], n);
  idft(f, M);
  for (i = 0; i < n; ++i) {
    unsigned long long t = f[i].get();
    t >>= 5, t *= inv, t &= 0x3ffffffffffffffllu;
    printf("%llu\n", t);
  }
}
