Problem: Let's define radix sum of number a consisting of digits a_1, … ,a_k and number b consisting of digits b_1, … ,b_k(we add leading zeroes to the shorter number to match longer length) as number s(a,b) consisting of digits (a_1+b_1)mod 10, … ,(a_k+b_k)mod 10. The radix sum of several integers is defined as follows: s(t_1, … ,t_n)=s(t_1,s(t_2, … ,t_n))

You are given an array x_1, … ,x_n. The task is to compute for each integer i (0 ≤ i < n) number of ways to consequently choose one of the integers from the array n times, so that the radix sum of these integers is equal to i. Calculate these values modulo 2^{58}.

Input

The first line contains integer n — the length of the array(1 ≤ n ≤ 100000).

The second line contains n integers x_1, … x_n — array elements(0 ≤ x_i < 100000).

Output

Output n integers y_0, …, y_{n-1} — y_i should be equal to corresponding number of ways modulo 2^{58}.

Examples

Input


2
5 6


Output


1
2


Input


4
5 7 5 7


Output


16
0
64
0

Note

In the first example there exist sequences: sequence (5,5) with radix sum 0, sequence (5,6) with radix sum 1, sequence (6,5) with radix sum 1, sequence (6,6) with radix sum 2.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int n;
struct poly {
  unsigned long long p[5];
  poly() { memset(p, 0, sizeof(p)); }
  poly operator*(poly b) {
    poly ret;
    for (int o = 0; o < 5; o++) ret.p[o] = 0;
    for (int i = 0; i < 5; i++)
      for (int j = 0; j < 5; j++)
        if (i + j >= 5)
          ret.p[i + j - 5] -= 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 < 5; o++) ret.p[o] = 0;
    for (int i = 0; i < 5; i++) ret.p[i] = p[i] - b.p[i];
    return ret;
  }
  poly operator+(poly b) {
    poly ret;
    for (int o = 0; o < 5; o++) ret.p[o] = 0;
    for (int i = 0; i < 5; i++) ret.p[i] += p[i] + b.p[i];
    return ret;
  }
  poly evx(int x, int pp) {
    if (pp == 0) {
      unsigned long long niz[15];
      memset(niz, 0, sizeof(niz));
      poly ret;
      for (int o = 0; o < 5; o++) ret.p[o] = 0;
      for (int i = 0; i < 5; i++) niz[i + x] = p[i];
      for (int i = 5; i < 10; i++) niz[i] = -niz[i];
      for (int i = 0; i < 15; i++) ret.p[i % 5] += niz[i];
      return ret;
    } else {
      poly ret;
      for (int o = 0; o < 5; o++) ret.p[o] = 0;
      for (int i = 0; i < 5; i++) ret.p[i] = p[i];
      ret = ret.evx(10 - x, 0);
      return ret;
    }
  }
  void ispis() {
    for (int i = 0; i < 5; 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 < 5; 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 < 5; 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 = 4; 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 < 5; j++) {
      for (int k = 0; k < 5; k++) a[i].p[j] /= 2;
      for (int k = 0; k < 5; k++)
        a[i].p[j] *= (unsigned long long)14757395258967641293;
    }
}
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\n", pol[i].p[0] % mod);
  return 0;
}