2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
struct Ring {
  unsigned long long a[5];
  Ring() { memset(a, 0, sizeof a); }
  Ring operator+(Ring r) {
    Ring R = r;
    for (int i = 0; i < 5; i++) R.a[i] += a[i];
    return R;
  }
  void operator+=(Ring r) { (*this) = (*this) + r; }
  Ring operator*(Ring r) {
    Ring R;
    for (int i = 0; i < 5; i++)
      for (int j = 0; j < 5; j++)
        i + j < 5 ? R.a[i + j] += a[i] * r.a[j]
                  : R.a[i + j - 5] -= a[i] * r.a[j];
    return R;
  }
  void operator*=(Ring r) { (*this) = (*this) * r; }
  Ring operator<<(int k) {
    Ring R;
    for (int i = 0; i < 5; i++) {
      int j = (i + k) % 10;
      j < 5 ? R.a[j] = a[i] : R.a[j - 5] = -a[i];
    }
    return R;
  }
  unsigned long long real() { return a[0] + a[1]; }
} x[N], w[10], tmp[10];
unsigned long long fpow(unsigned long long a, unsigned long long n) {
  unsigned long long rlt = 1;
  while (n) {
    if (n & 1) rlt *= a;
    a *= a, n >>= 1;
  }
  return rlt;
}
Ring fpow(Ring a, int n) {
  Ring rlt;
  rlt.a[0] = 1;
  while (n) {
    if (n & 1) rlt *= a;
    a *= a, n >>= 1;
  }
  return rlt;
}
void DFT(int l, int r, int op) {
  if (r - l == 1) return;
  int p = (r - l) / 10;
  for (int i = l; i < r; i += p) DFT(i, i + p, op);
  for (int i = 0; i < p; i++) {
    for (int j = 0; j < 10; j++) tmp[j] = x[l + i + j * p];
    for (int j = 0; j < 10; j++) {
      Ring &r = x[l + i + j * p];
      r = Ring();
      for (int k = 0; k < 10; k++) r += (tmp[k] << j * k * op);
    }
  }
}
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0, k; i < n; i++) {
    scanf("%d", &k);
    x[k].a[0]++;
  }
  DFT(0, N, 1);
  for (int i = 0; i < N; i++) x[i] = fpow(x[i], n);
  DFT(0, N, 9);
  unsigned long long inv = fpow(5, (1ull << 63) - 5);
  for (int i = 0; i < n; ++i)
    printf("%I64d\n", (x[i].real() >> 5) * inv & ((1ull << 58) - 1));
  return 0;
}
