2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
int get() {
  char ch;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  if (ch == '-') {
    int s = 0;
    while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
    return -s;
  }
  int s = ch - '0';
  while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
  return s;
}
const int L = 10;
const int N = 1e5 + 5;
const unsigned long long D = 1ll << 58;
const unsigned long long Mod = (1ll << 58) - 1;
unsigned long long W;
int n;
unsigned long long tmp[25];
struct poly {
  unsigned long long a[L];
  unsigned long long &operator[](int x) { return a[x]; }
  void init() {
    for (int i = 0; i <= 9; i++) a[i] = 0;
  }
  friend poly operator*(poly a, poly b) {
    poly c;
    for (int i = 0; i <= 9; i++) c[i] = 0;
    for (int i = 0; i <= 18; i++) tmp[i] = 0;
    for (int i = 0; i <= 9; i++)
      for (int j = 0; j <= 9; j++) tmp[i + j] += a[i] * b[j];
    for (int i = 0; i <= 9; i++) c[i] = tmp[i];
    for (int i = 10; i <= 18; i++) c[i - 10] += tmp[i];
    return c;
  }
  friend poly operator+(poly a, poly b) {
    poly c;
    for (int i = 0; i <= 9; i++) c[i] = a[i] + b[i];
    return c;
  }
  poly shift(int len) {
    len = (len % 10 + 10) % 10;
    poly ret;
    for (int i = 0; i <= 9; i++) tmp[(i + len) % 10] = a[i];
    for (int i = 0; i <= 9; i++) ret[i] = tmp[i];
    return ret;
  }
  unsigned long long calc() {
    for (int i = 5; i <= 9; i++) {
      a[i - 5] -= a[i];
      a[i] = 0;
    }
    unsigned long long v = -a[1];
    for (int i = 0; i <= 4; i++)
      if (i & 1)
        a[i] += v;
      else
        a[i] -= v;
    unsigned long long ret = a[0];
    ret &= W;
    ret >>= 5;
    for (int tim = 1; tim <= 5; tim++) {
      for (; ret % 5 != 0; ret += D)
        ;
      ret /= 5;
    }
    return ret;
  }
} f[N], a[20], b[20];
poly quickmi(poly a, int tim) {
  poly ret;
  ret.init();
  ret[0] = 1;
  for (; tim; tim /= 2, a = a * a)
    if (tim & 1) ret = ret * a;
  return ret;
}
void DFT(poly *a) {
  for (int i = 0; i < 10; i++) {
    b[i].init();
    for (int j = 0; j < 10; j++) b[i] = b[i] + a[j].shift(i * j);
  }
  for (int i = 0; i < 10; i++) a[i] = b[i];
}
void IDFT(poly *a) {
  DFT(a);
  reverse(a + 1, a + 10);
}
int main() {
  W = 1;
  for (int i = 1; i <= 63; i++) W = W * 2;
  W--;
  n = get();
  for (int i = 1; i <= n; i++) {
    int x = get();
    f[x][0]++;
  }
  int Lim = 1e5;
  for (int i = 1; i < Lim; i *= 10)
    for (int j = 0; j < Lim; j += i * 10)
      for (int k = 0; k < i; k++) {
        for (int w = 0; w <= 9; w++) a[w] = f[j + k + i * w];
        DFT(a);
        for (int w = 0; w <= 9; w++) f[j + k + i * w] = a[w];
      }
  for (int i = 0; i < Lim; i++) f[i] = quickmi(f[i], n);
  for (int i = 1; i < Lim; i *= 10)
    for (int j = 0; j < Lim; j += i * 10)
      for (int k = 0; k < i; k++) {
        for (int w = 0; w <= 9; w++) a[w] = f[j + k + i * w];
        IDFT(a);
        for (int w = 0; w <= 9; w++) f[j + k + i * w] = a[w];
      }
  for (int i = 0; i <= n - 1; i++) printf("%I64d\n", f[i].calc());
  return 0;
}
