CSES - And Subset Count
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are given an array of nn integers. Your task is to calculate the number of non-empty subsets whose elements' bitwise and is equal to kk for each k=0,1,,nk = 0, 1,\dots, n.

Input

The first line has an integer nn: the size of the array.

The next line has nn integers a1,a2,,ana_1, a_2,\dots, a_n: the contents of the array.

Output

Print n+1n + 1 integers as specified above modulo 109+710^9 + 7.

Constraints

  • 1n21051 \le n \le 2 \cdot 10^5
  • 0ain0 \le a_i \le n

Example

Input:

4
3 1 3 4

Output:

7 4 0 3 1