Time limit: 0.5s
Memory limit: 256MB
Input:
Output:
I don't think we're alike at all, Mr. White. You're not a cautious man at all... You have poor judgement. I cannot work with someone with poor judgement.
- Gustavo Fring, Breaking Bad
Gus Fring is a very careful man. He doesn't mess with you. When he asks someone to solve a problem, he gives a completely formal statement. And today he asked YOU.
For a positive integer , define as the largest number , such that . Also define .
You are given a positive integer . Find the number of multisets of positive integers, which satisfy the following conditions:
- All elements of are nonnegative powers of .
- The sum of elements of is .
- There is no way to split elements of into two groups so that , where is the sum of the elements in the first group, and is the sum of the elements in the second group.
Solve this problem for .
Since the answers can be very large, output them modulo .
Input data
The only line of the input contains a single integer ().
Output data
Output integers: answers to the problem for , modulo .
Example
stdin
10
stdout
1 1 2 1 1 3 6 1 1 2