2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
constexpr int D = 5;
constexpr int ten[] = {1, 10, 100, 1000, 10000, 100000};
constexpr int kN = ten[D];
using ULL = unsigned long long;
using Field = std::array<ULL, 4>;
Field mul(const Field& a, const Field& b) {
  std::array<ULL, 7> tmp{};
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      tmp[i + j] += a[i] * b[j];
    }
  }
  tmp[1] -= tmp[6];
  tmp[0] -= tmp[5];
  tmp[3] += tmp[4];
  tmp[2] -= tmp[4];
  tmp[1] += tmp[4];
  tmp[0] -= tmp[4];
  return Field{tmp[0], tmp[1], tmp[2], tmp[3]};
}
Field add(const Field& a, const Field& b) {
  Field ret;
  for (int i = 0; i < 4; ++i) {
    ret[i] = a[i] + b[i];
  }
  return ret;
}
Field w[100];
Field inv_w[100];
Field x[kN];
void transform(Field* a, bool inv) {
  for (int d = 0; d < D; ++d) {
    for (int b = 0; b < kN; ++b) {
      if (b / ten[d] % 10 == 0) {
        Field tmp[10] = {};
        for (int i = 0; i < 10; ++i) {
          for (int j = 0; j < 10; ++j) {
            tmp[i] =
                add(tmp[i], mul(a[b + j * ten[d]], (inv ? inv_w : w)[i * j]));
          }
        }
        for (int i = 0; i < 10; ++i) {
          a[b + i * ten[d]] = tmp[i];
        }
      }
    }
  }
}
Field power(Field a, ULL b) {
  Field ret{1};
  while (b) {
    if (b & 1) ret = mul(ret, a);
    a = mul(a, a);
    b >>= 1;
  }
  return ret;
}
int main() {
  w[0][0] = 1;
  w[1][1] = 1;
  for (int i = 2; i < 100; ++i) w[i] = mul(w[i - 1], w[1]);
  inv_w[0][0] = 1;
  inv_w[1][0] = 1;
  inv_w[1][1] = -1;
  inv_w[1][2] = 1;
  inv_w[1][3] = -1;
  for (int i = 2; i < 100; ++i) inv_w[i] = mul(inv_w[i - 1], inv_w[1]);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int v;
    scanf("%d", &v);
    x[v][0]++;
  }
  transform(x, false);
  for (int i = 0; i < kN; ++i) {
    x[i] = power(x[i], n);
  }
  transform(x, true);
  const ULL MOD = 1ULL << 58;
  const ULL inv_5 = 14757395258967641293ULL;
  for (int i = 0; i < n; ++i) {
    printf("%llu\n", (x[i][0] * inv_5 * inv_5 * inv_5 * inv_5 * inv_5 >> 5) %
                         (1ULL << 58));
  }
}
