2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
namespace io {
const int SIZE = 7e5 + 10;
char buff[SIZE];
char *l = buff, *r = buff;
void init() {
  l = buff;
  r = l + fread(buff, 1, SIZE, stdin);
}
char gc() {
  if (l == r) init();
  if (l == r) return EOF;
  return *(l++);
}
void read(int &x) {
  x = 0;
  char ch = gc();
  while (!isdigit(ch)) ch = gc();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = gc();
}
}  // namespace io
using io::read;
template <int N>
struct Number {
  unsigned long long a[N - 1];
  Number() { memset(a, 0, sizeof(a)); }
  friend ostream &operator<<(ostream &out, const Number<N> &b) {
    out << '{';
    for (int i = 0; i < N - 2; ++i) out << b.a[i] << ',';
    return out << b.a[N - 2] << '}';
  }
  Number operator+(const Number &b) const {
    Number ret;
    for (int i = 0; i < N - 1; ++i) ret.a[i] = a[i] + b.a[i];
    return ret;
  }
  Number operator-(const Number &b) const {
    Number ret;
    for (int i = 0; i < N - 1; ++i) ret.a[i] = a[i] - b.a[i];
    return ret;
  }
  Number operator*(const Number &b) const {
    Number ret;
    unsigned long long tmp = 0;
    for (int i = 0; i < N - 1; ++i)
      for (int j = 0; j < N - 1; ++j)
        (i + j == N - 1 ? tmp : ret.a[i + j >= N ? i + j - N : i + j]) +=
            a[i] * b.a[j];
    for (int i = 0; i < N - 1; ++i) ret.a[i] -= tmp;
    return ret;
  }
  bool operator<(const Number &b) const {
    for (int i = 0; i < N - 1; ++i)
      if (a[i] != b.a[i]) return a[i] < b.a[i];
    return 0;
  }
  Number operator<<(const int &c) const {
    Number ret;
    unsigned long long tmp = 0;
    for (int i = 0; i < N - 1; ++i)
      (i + c == N - 1 ? tmp : ret.a[i + c >= N ? i + c - N : i + c]) += a[i];
    for (int i = 0; i < N - 1; ++i) ret.a[i] -= tmp;
    return ret;
  }
};
template <int N>
Number<N> fp(Number<N> x, int y) {
  Number<N> ret;
  ret.a[0] = 1;
  for (; y; y >>= 1, x = x * x)
    if (y & 1) ret = ret * x;
  return ret;
}
void DFT(Number<5> *a) {
  Number<5> b[10];
  for (int i = 0; i < 10; ++i)
    for (int j = 0, t = 0; j < 10; ++j, (t += i) >= 10 ? t -= 10 : 0) {
      if (~t & 1)
        b[i] = b[i] + (a[j] << (t >> 1));
      else
        b[i] = b[i] - (a[j] << ((t + 5) >> 1) % 5);
    }
  for (int i = 0; i < 10; ++i) a[i] = b[i];
}
const int pwd[6] = {1, 10, 100, 1000, 10000, 100000};
const unsigned long long inv5 = 14757395258967641293ull;
void FWT(Number<5> *a, bool rev) {
  for (int i = 0; i < 5; ++i) {
    for (int cj = 0; cj < 100000; cj += pwd[i + 1])
      for (int j = cj; j < cj + pwd[i]; ++j) {
        Number<5> t[10];
        for (int k = 0; k < 10; ++k) t[k] = a[j + k * pwd[i]];
        if (rev) reverse(t + 1, t + 10);
        DFT(t);
        for (int k = 0; k < 10; ++k) a[j + k * pwd[i]] = t[k];
      }
  }
  if (rev) {
    unsigned long long c = inv5 * inv5 * inv5 * inv5 * inv5;
    for (int i = 0; i < 100000; ++i) a[i].a[0] *= c;
  }
}
const int N = 100000;
int n;
Number<5> a[N];
int main() {
  read(n);
  for (int i = 0; i < n; ++i) {
    int x;
    read(x);
    ++a[x].a[0];
  }
  FWT(a, 0);
  for (int i = 0; i < 100000; ++i) a[i] = fp(a[i], n);
  FWT(a, 1);
  for (int i = 0; i < n; ++i) cout << (a[i].a[0] >> 5) % (1ll << 58) << '\n';
}
