2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const unsigned long long mod = 1llu << 58;
const unsigned long long inv = 6723469279985657373llu;
struct mod_int {
  unsigned long long a0, a1, a2, a3;
  mod_int(unsigned long long a0 = 0, unsigned long long a1 = 0,
          unsigned long long a2 = 0, unsigned long long a3 = 0)
      : a0(a0), a1(a1), a2(a2), a3(a3) {}
  mod_int operator+(const mod_int& a) const {
    return mod_int(a0 + a.a0, a1 + a.a1, a2 + a.a2, a3 + a.a3);
  }
  void operator+=(const mod_int& a) {
    a0 += a.a0;
    a1 += a.a1;
    a2 += a.a2;
    a3 += a.a3;
  }
  mod_int operator*(const mod_int& a) const {
    return mod_int(
        a0 * a.a0 - a1 * a.a3 - a3 * a.a1 - a2 * a.a2 - a2 * a.a3 - a3 * a.a2,
        a1 * a.a0 + a0 * a.a1 + a3 * a.a1 + a2 * a.a2 + a1 * a.a3 - a3 * a.a3,
        a2 * a.a0 + a1 * a.a1 - a3 * a.a1 + a0 * a.a2 - a2 * a.a2 - a1 * a.a3,
        a3 * a.a0 + a2 * a.a1 + a3 * a.a1 + a1 * a.a2 + a2 * a.a2 + a0 * a.a3 +
            a1 * a.a3);
  }
  void divN() {
    a0 = a0 * inv >> 5;
    a1 = a1 * inv >> 5;
    a2 = a2 * inv >> 5;
    a3 = a3 * inv >> 5;
  }
  void operator++() { ++a0; }
} omg[10], ww[10][10], a[N];
void DFT_init() {
  omg[0] = mod_int(1);
  for (int i = 1; i < 10; ++i) omg[i] = omg[i - 1] * mod_int(0, 1);
  for (int i = 0; i < 10; ++i)
    for (int j = 0; j < 10; ++j) ww[i][j] = omg[i * j % 10];
}
void DFT(mod_int* f) {
  static mod_int g[15];
  for (int i = 0; i < 10; ++i) g[i] = mod_int();
  for (int i = 0; i < 10; ++i)
    for (int j = 0; j < 10; ++j) g[j] += f[i] * ww[i][j];
  for (int i = 0; i < 10; ++i) f[i] = g[i];
}
const int pw[] = {1, 10, 100, 1000, 10000};
void FWT(mod_int* f, int flag = 0) {
  static mod_int g[15];
  for (int i = 0; i < 5; ++i) {
    int t = pw[i];
    for (int j = 0; j < N; j += t * 10)
      for (int k = 0; k < t; ++k) {
        for (int l = 0; l < 10; ++l) g[l] = f[j + k + l * t];
        DFT(g);
        if (flag) reverse(g + 1, g + 10);
        for (int l = 0; l < 10; ++l) f[j + k + l * t] = g[l];
      }
  }
  if (flag)
    for (int i = 0; i < N; ++i) f[i].divN();
}
mod_int ksm(mod_int a, int b, mod_int c = mod_int(1, 0, 0, 0)) {
  for (; b; b /= 2, a = a * a)
    if (b & 1) c = c * a;
  return c;
}
int n;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  DFT_init();
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    ++a[x];
  }
  FWT(a);
  for (int i = 0; i < N; ++i) a[i] = ksm(a[i], n);
  FWT(a, 1);
  for (int i = 0; i < n; ++i) cout << (a[i].a0 & (mod - 1)) << '\n';
  return 0;
}
