#include <bits/stdc++.h>
const int N = 100000;
const unsigned long long mod = 1LL << 58;
const unsigned long long i55 = 6723469279985657373;
int n, x;
struct poly {
  unsigned long long a[4];
  unsigned long long &operator[](int index) { return a[index]; }
  unsigned long long operator[](int index) const { return a[index]; }
  poly operator+(const poly &rhs) const {
    return (poly){a[0] + rhs[0], a[1] + rhs[1], a[2] + rhs[2], a[3] + rhs[3]};
  }
  poly operator-(const poly &rhs) const {
    return (poly){a[0] - rhs[0], a[1] - rhs[1], a[2] - rhs[2], a[3] - rhs[3]};
  }
  poly operator*(const poly &rhs) const {
    poly ret = (poly){0, 0, 0, 0};
    for (int i = 0; i < 4; ++i)
      for (int j = 0; j < 4; ++j)
        if (i + j < 4) {
          ret[i + j] += a[i] * rhs[j];
        } else if (i + j == 4) {
          unsigned long long v = a[i] * rhs[j];
          for (int k = 0; k < 4; ++k) ret[k] += v = -v;
        } else {
          ret[i + j - 5] -= a[i] * rhs[j];
        }
    return ret;
  }
} a[N];
unsigned long long pow(unsigned long long x, unsigned long long y,
                       unsigned long long ans = 1) {
  for (; y; y >>= 1, x = x * x)
    if (y & 1) ans = ans * x;
  return ans;
}
poly pow(poly x, unsigned long long y, poly ans = (poly){1, 0, 0, 0}) {
  for (; y; y >>= 1, x = x * x)
    if (y & 1) ans = ans * x;
  return ans;
}
poly w10[10];
void fftinit() {
  const unsigned long long qaq = 18446744073709551615;
  w10[0] = (poly){1, 0, 0, 0};
  w10[1] = (poly){0, 1, 0, 0};
  for (int i = 2; i < 10; ++i) w10[i] = w10[i - 1] * w10[1];
}
void fft(poly *A, int typ) {
  if (!typ) std::reverse(w10 + 1, w10 + 10);
  poly b[10];
  for (int i = 1; i < 100000; i *= 10) {
    for (int j = 0; j < 100000; ++j)
      if (j / i % 10 == 0) {
        for (int k = 0; k < 10; ++k) {
          b[k] = (poly){0, 0, 0, 0};
          for (int l = 0; l < 10; ++l)
            b[k] = b[k] + A[j + i * l] * w10[k * l % 10];
        }
        for (int k = 0; k < 10; ++k) A[j + i * k] = b[k];
      }
  }
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  std::cin >> n;
  for (int i = 1; i <= n; ++i) std::cin >> x, ++a[x][0];
  fftinit(), fft(a, 1);
  for (int i = 0; i < 100000; ++i) a[i] = pow(a[i], n);
  fft(a, 0);
  for (int i = 0; i < n; ++i)
    std::cout << (a[i][0] * i55 / 32 & mod - 1) << '\n';
  return 0;
}
