#ARC077B. [ABC066D] 11
[ABC066D] 11
Score : points
Problem Statement
You are given an integer sequence of length , , which consists of the integers . It is known that each of the integers appears at least once in this sequence.
For each integer , find the number of the different subsequences (not necessarily contiguous) of the given sequence with length , modulo .
Notes
- If the contents of two subsequences are the same, they are not separately counted even if they originate from different positions in the original sequence.
- A subsequence of a sequence with length is a sequence obtained by selecting of the elements of and arranging them without changing their relative order. For example, the sequences and are subsequences of , while and are not.
Constraints
- Each of the integers appears in the sequence.
- and are integers.
Input
Input is given from Standard Input in the following format:
...
Output
Print lines. The -th line should contain the number of the different subsequences of the given sequence with length , modulo .
There are three subsequences with length : and and .
There are five subsequences with length : and and and and .
There are four subsequences with length : and and and .
There is one subsequence with length : .
There is one subsequence with length : .
There is one subsequence with length : .
Be sure to print the numbers modulo .