2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
int n, m, x, base[100005][1];
struct Complex {
  unsigned long long a[10];
  Complex() { memset(a, 0, sizeof(a)); }
  Complex(int x) {
    memset(a, 0, sizeof(a));
    a[0] = x;
  }
  Complex(int x, int y) {
    memset(a, 0, sizeof(a));
    a[0] = x, a[1] = y;
  }
  Complex operator+(const Complex &k) const {
    Complex o;
    for (int i = 0; i < 10; i++) o.a[i] = a[i] + k.a[i];
    return o;
  }
  Complex operator*(const Complex &k) const {
    Complex o;
    for (int i = 0; i < 10; i++)
      for (int j = 0; j < 10; j++)
        o.a[(i + j) % 10] = o.a[(i + j) % 10] + a[i] * k.a[j];
    for (int i = 0; i < 10 / 2; i++) {
      o.a[i] -= o.a[i + 10 / 2];
      o.a[i + 10 / 2] = 0;
    }
    o.a[0] -= o.a[4], o.a[1] += o.a[4], o.a[2] -= o.a[4], o.a[3] += o.a[4],
        o.a[4] = 0;
    return o;
  }
} inv, A[10][10], invA[10][10], a[100005];
Complex pow(Complex n, long long m) {
  Complex s = n, ans = Complex(1);
  while (m) {
    if (m & 1) ans = ans * s;
    s = s * s;
    m >>= 1;
  }
  return ans;
}
void DFT(Complex *a) {
  Complex aa[10];
  for (int i = 0, s = 1; i < 1; i++, s *= 10)
    for (int j = 0; j < n; j++)
      if (!base[j][i]) {
        for (int k = 0; k < 10; k++) aa[k] = Complex();
        for (int k = 0; k < 10; k++)
          for (int l = 0; l < 10; l++) aa[k] = aa[k] + a[j + l * s] * A[l][k];
        for (int k = 0; k < 10; k++) a[j + k * s] = aa[k];
      }
}
void IDFT(Complex *a) {
  Complex aa[10];
  for (int i = 0, s = 1; i < 1; i++, s *= 10)
    for (int j = 0; j < n; j++)
      if (!base[j][i]) {
        for (int k = 0; k < 10; k++) aa[k] = Complex();
        for (int k = 0; k < 10; k++)
          for (int l = 0; l < 10; l++)
            aa[k] = aa[k] + a[j + l * s] * invA[l][k];
        for (int k = 0; k < 10; k++) a[j + k * s] = aa[k];
      }
}
int main() {
  n = 10;
  inv = pow(Complex(5), (1LL << 57) - 1);
  for (int i = 0; i < n; i++) {
    base[i][0] = i % 10;
    for (int j = 1; j < 1; j++) base[i][j] = base[i / 10][j - 1];
  }
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++) {
      A[i][j] = pow(Complex(0, 1), i * j);
      invA[i][j] = pow(Complex(0, 1), 10 * 10 - i * j) * inv;
    }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    a[x] = a[x] + Complex(1);
  }
  DFT(a);
  for (int i = 0; i < n; i++) a[i] = pow(a[i], m);
  IDFT(a);
  for (int i = 0; i < m; i++) {
    a[i].a[0] >>= 1;
    a[i].a[0] &= ((1LL << 58) - 1);
    printf("%llu\n", a[i].a[0]);
  }
}
