Given a sequence . It's guaranteed that for all i, means every element in the sequence divides .
A graph is built with this sequence. Specifically, an edge exists when and only when and . Obviously, this is a DAG.
Your task is to calculate the count of different paths from 1 to i for all i between 1 and n.
Input
The first line contains two integers, and .
The second line contains integers, representing the sequence .
It's guaranteed that .
Output
lines. Each line contains an integer, the integer is the count of different paths from 1 to i modulo .
Constraints
The two paths from 1 to 3 are and .