- Time limit: 1.00 s
- Memory limit: 512 MB
You are given an array of integers. Your task is to calculate the number of non-empty subsets whose elements' bitwise and is equal to for each .
Input
The first line has an integer : the size of the array.
The next line has integers : the contents of the array.
Output
Print integers as specified above modulo .
Constraints
Example
Input:
4 3 1 3 4
Output:
7 4 0 3 1