2
0 1
 1
0

1
2
 1

#include <bits/stdc++.h>
using namespace std;
unsigned long long a_part[10], b_part[10], c_result[20];
void conv1d() {
  memset(c_result, 0, sizeof(c_result));
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++) c_result[i + j] += a_part[i] * b_part[j];
  for (int i = 0; i < 10; i++) c_result[i] += c_result[i + 10];
}
const int step[5] = {1, 10, 100, 1000, 10000};
char done[100000];
vector<unsigned long long> conv5d(vector<unsigned long long> a,
                                  vector<unsigned long long> b) {
  memset(done, 0, sizeof(done));
  for (int dim = 0; dim < 5; dim++) {
    const int step = ::step[dim];
    for (int start = 0; start < 100000; start++) {
      if (!done[start]) {
        for (int j = 0; j < 10; j++) {
          int x = start + j * step;
          done[x] = 1;
          a_part[j] = a[x];
          b_part[j] = b[x];
        }
        conv1d();
        for (int j = 0; j < 10; j++) {
          int x = start + j * step;
          a[x] = c_result[j];
        }
      }
    }
  }
  return a;
}
vector<unsigned long long> stepen(vector<unsigned long long> a, int k) {
  if (k == 1) return a;
  auto b = stepen(a, k >> 1);
  b = conv5d(b, b);
  if (k & 1) b = conv5d(b, a);
  return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  int n;
  cin >> n;
  vector<unsigned long long> c(100000, 0);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    c[x]++;
  }
  c = stepen(c, n);
  for (int i = 0; i < n; i++) cout << (c[i] & ((1ull << 58) - 1)) << '\n';
}
