2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
int gi() {
  int x = 0, w = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') w = 0, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return w ? x : -x;
}
const int N = 100000;
const unsigned long long mod = (1ll << 58) - 1;
struct num {
  unsigned long long s[5];
  num() { s[0] = s[1] = s[2] = s[3] = s[4] = 0; }
  num operator+(const num &b) const {
    num c;
    for (int i = 0; i < 5; ++i) c.s[i] = s[i] + b.s[i];
    return c;
  }
  num operator-(const num &b) const {
    num c;
    for (int i = 0; i < 5; ++i) c.s[i] = s[i] - b.s[i];
    return c;
  }
  num operator*(const num &b) const {
    num c;
    for (int i = 0; i < 5; ++i)
      for (int j = 0; j < 5; ++j)
        i + j < 5 ? c.s[i + j] += s[i] * b.s[j]
                  : c.s[i + j - 5] -= s[i] * b.s[j];
    return c;
  }
  void kill() {
    unsigned long long v = s[4];
    s[4] -= v;
    s[3] += v;
    s[2] -= v;
    s[1] += v;
    s[0] -= v;
  }
} a[N], w[10];
unsigned long long fastpow(unsigned long long a, unsigned long long b) {
  unsigned long long res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
num fastpow(num a, int b) {
  num res;
  res.s[0] = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
void dft(num *P, int op) {
  for (int i = 1; i < N; i *= 10)
    for (int p = i * 10, j = 0; j < N; j += p)
      for (int k = 0; k < i; ++k) {
        num tmp[10];
        for (int x = 0; x < 10; ++x)
          for (int y = 0; y < 10; ++y)
            tmp[x] = tmp[x] + P[j + k + y * i] * w[x * y * op % 10];
        for (int x = 0; x < 10; ++x) P[j + k + x * i] = tmp[x];
      }
}
int main() {
  int n = gi();
  for (int i = 1; i <= n; ++i) ++a[gi()].s[0];
  w[0].s[0] = 1;
  w[1].s[1] = 1;
  for (int i = 2; i < 10; ++i) w[i] = w[i - 1] * w[1];
  dft(a, 1);
  for (int i = 0; i < N; ++i) a[i] = fastpow(a[i], n);
  dft(a, 9);
  for (int i = 0; i < N; ++i) a[i].kill();
  unsigned long long inv = fastpow(5, (1ull << 63) - 5);
  for (int i = 0; i < n; ++i) printf("%I64d\n", (a[i].s[0] >> 5) * inv & mod);
  return 0;
}
