2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
uint64_t inv5 = 14757395258967641293ULL;
const int N = 100000;
const int M = 10;
const long double pi2 = acos((long double)-1) * 2;
using TM = array<uint64_t, M>;
TM a[N];
TM mul(const TM &a, const TM &b) {
  TM ret = {};
  for (int i = 0; i < M; i++)
    for (int j = 0; j < M; j++) {
      ret[(i + j) % M] += a[i] * b[j];
    }
  return ret;
}
TM pow2(TM a, int n) {
  if (!n) {
    TM ret = {};
    ret[0] = 1;
    return ret;
  }
  TM t = pow2(a, n / 2);
  t = mul(t, t);
  if (n & 1) t = mul(t, a);
  return t;
}
void fft(bool inv = 0) {
  int sh = inv ? M - 1 : 1;
  for (int i = 1; i < N; i *= M)
    for (int j = 0; j < N; j += M * i)
      for (int k = j; k < j + i; k++) {
        TM b[M] = {};
        for (int s = 0; s < M; s++)
          for (int t = 0; t < M; t++)
            for (int r = 0; r < M; r++)
              b[s][(r + s * t * sh) % M] += a[k + t * i][r];
        for (int s = 0; s < M; s++) a[k + s * i] = b[s];
      }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[x][0]++;
  }
  fft(0);
  for (int i = 0; i < N; i++) a[i] = pow2(a[i], n);
  fft(1);
  for (int i = 0; i < n; i++) {
    long double tot = 0;
    for (int j = 0; j < M; j++) tot += cos(j * pi2 / M) * a[i][j];
    uint64_t res = round(tot);
    res /= 32;
    for (int j = 0; j < 5; j++) res *= inv5;
    printf("%llu\n", res % (1ULL << 58));
  }
}
