2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
const unsigned long long iv = 6723469279985657373ull;
struct Complex {
  unsigned long long x[4];
  Complex(unsigned long long _x = 0) {
    x[0] = _x;
    x[1] = x[2] = x[3] = 0;
  }
  unsigned long long &operator[](const int &i) { return x[i]; }
  unsigned long long operator[](const int &i) const { return x[i]; }
} f[100100], W[11], tp[10];
inline Complex operator+(const Complex &A, const Complex &B) {
  Complex ans;
  ans[0] = A[0] + B[0];
  ans[1] = A[1] + B[1];
  ans[2] = A[2] + B[2];
  ans[3] = A[3] + B[3];
  return ans;
}
inline Complex operator-(const Complex &A, const Complex &B) {
  Complex ans;
  ans[0] = A[0] - B[0];
  ans[1] = A[1] - B[1];
  ans[2] = A[2] - B[2];
  ans[3] = A[3] - B[3];
  return ans;
}
inline Complex operator*(const Complex &A, const Complex &B) {
  unsigned long long c[7];
  Complex ans;
  c[0] = A[0] * B[0];
  c[1] = A[1] * B[0] + A[0] * B[1];
  c[2] = A[2] * B[0] + A[1] * B[1] + A[0] * B[2];
  c[3] = A[3] * B[0] + A[2] * B[1] + A[1] * B[2] + A[0] * B[3];
  c[4] = A[3] * B[1] + A[2] * B[2] + A[1] * B[3];
  c[5] = A[3] * B[2] + A[2] * B[3];
  c[6] = A[3] * B[3];
  c[5] -= c[6];
  c[4] -= c[6];
  c[3] -= c[6];
  c[2] -= c[6];
  c[4] -= c[5];
  c[3] -= c[5];
  c[2] -= c[5];
  c[1] -= c[5];
  c[3] -= c[4];
  c[2] -= c[4];
  c[1] -= c[4];
  c[0] -= c[4];
  ans[0] = c[0];
  ans[1] = c[1];
  ans[2] = c[2];
  ans[3] = c[3];
  return ans;
}
inline Complex operator*(const Complex &A, const unsigned long long &B) {
  Complex ans;
  ans[0] = A[0] * B;
  ans[1] = A[1] * B;
  ans[2] = A[2] * B;
  ans[3] = A[3] * B;
  return ans;
}
Complex qpow(Complex base, int n) {
  Complex ans(1);
  while (n) {
    if (n & 1) ans = ans * base;
    base = base * base;
    n >>= 1;
  }
  return ans;
}
void NTT(Complex *A, int dft) {
  for (int D = 1; D <= 10000; D *= 10)
    for (int i = 0; i < 100000; ++i)
      if ((i / D) % 10 == 0) {
        memset(tp, 0, sizeof(tp));
        for (int j = 0; j < 10; ++j)
          for (int k = 0; k < 10; ++k)
            tp[j] = tp[j] + W[((dft * j * k) % 10 + 10) % 10] * A[i + k * D];
        for (int j = 0; j < 10; ++j) A[i + j * D] = tp[j];
      }
  if (dft == -1)
    for (int i = 0; i < 100000; ++i) A[i] = A[i] * iv;
}
inline int read() {
  int n = 0;
  char a;
  bool z = false;
  while (a = getchar()) {
    if (a > '9' || a < '0')
      if (z)
        break;
      else
        continue;
    if (!z) z = true;
    n = (n << 1) + (n << 3) + (a ^ 48);
  }
  return n;
}
int main() {
  int n = read();
  for (int i = 1; i <= n; ++i) ++f[read()][0];
  W[0][0] = 1;
  W[1][3] = -1;
  for (int i = 2; i < 10; ++i) W[i] = W[i - 1] * W[1];
  NTT(f, 1);
  for (int i = 0; i < 100000; ++i) f[i] = qpow(f[i], n);
  NTT(f, -1);
  for (int i = 0; i < n; ++i) printf("%llu\n", f[i][0] / 32);
  return 0;
}
