#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int n;
struct poly {
  unsigned long long p[10];
  poly() { memset(p, 0, sizeof(p)); }
  poly operator*(poly b) {
    poly ret;
    for (int o = 0; o < 10; o++) ret.p[o] = 0;
    for (int i = 0; i < 10; i++)
      for (int j = 0; j < 10; j++)
        if (i + j >= 10)
          ret.p[i + j - 10] += p[i] * b.p[j];
        else
          ret.p[i + j] += p[i] * b.p[j];
    return ret;
  }
  poly operator-(poly b) {
    poly ret;
    for (int o = 0; o < 10; o++) ret.p[o] = 0;
    for (int i = 0; i < 10; i++) ret.p[i] -= p[i] + b.p[i];
    return ret;
  }
  poly operator+(poly b) {
    poly ret;
    for (int o = 0; o < 10; o++) ret.p[o] = 0;
    for (int i = 0; i < 10; i++) ret.p[i] += p[i] + b.p[i];
    return ret;
  }
  poly evx(int x, int pp) {
    if (pp == 0) {
      poly ret;
      for (int o = 0; o < 10; o++) ret.p[o] = 0;
      for (int i = 0; i < 10; i++) {
        if (i + x >= 10)
          ret.p[i + x - 10] = p[i];
        else
          ret.p[i + x] = p[i];
      }
      return ret;
    } else {
      poly ret;
      for (int o = 0; o < 10; o++) ret.p[o] = 0;
      for (int i = 0; i < 10; i++) {
        if (i - x < 0)
          ret.p[i - x + 10] = p[i];
        else
          ret.p[i - x] = p[i];
      }
      return ret;
    }
  }
  void ispis() {
    for (int i = 0; i < 10; i++) printf("%lld ", p[i]);
    printf(" ISPIS \n");
  }
} niz[10], pol[100010];
int br;
poly step(poly a, int pw) {
  poly ret;
  for (int o = 0; o < 10; o++) ret.p[o] = 0;
  ret.p[0] = 1;
  while (pw) {
    if (pw & 1) ret = a * ret;
    pw >>= 1;
    a = a * a;
  }
  return ret;
}
void fft(poly a[], bool invert) {
  int n = maxn;
  for (int len = n; len >= 10; len /= 10) {
    int hlen = len / 10;
    for (int i = 0; i < n; i += len) {
      for (int j = 0; j < hlen; j++) {
        br = 0;
        for (int k = 0; k < len; k += hlen) niz[br++] = a[i + j + k];
        for (int k = 0, b = 0; k < len; k += hlen, b++) {
          for (int o = 0; o < 10; o++) a[i + j + k].p[o] = 0;
          int c = 0;
          for (int o = 0; o < 10; o++) {
            a[i + j + k] = a[i + j + k] + niz[o].evx(c, invert);
            c += b;
            if (c >= 10) c -= 10;
          }
        }
      }
    }
  }
}
void mul(poly a[], int pw) {
  int n = maxn;
  fft(a, 0);
  for (int i = 0; i < n; i++) {
    a[i] = step(a[i], pw);
  }
  fft(a, 1);
  for (int i = 0; i < n; i++)
    for (int j = 9; j >= 4; j--) {
      unsigned long long pom = -a[i].p[j];
      a[i].p[j] += pom;
      a[i].p[j - 1] -= pom;
      a[i].p[j - 2] += pom;
      a[i].p[j - 3] -= pom;
      a[i].p[j - 4] += pom;
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 5; k++)
        a[i].p[j] *= (unsigned long long)14757395258967641293;
      for (int k = 0; k < 5; k++) a[i].p[j] /= 2;
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    pol[a].p[0]++;
  }
  mul(pol, n);
  unsigned long long mod = (((unsigned long long)1) << 58);
  for (int i = 0; i < n; i++) printf("%I64d ", pol[i].p[0] % mod);
  return 0;
}
