Piratski kod
문제
Captain Marrrtina, together with her pirate crew, after three months of searching for long lost treasure belonging to the most famous Italian pirate finally dug up chest full of treasure. But to unlock the chest she needs a secret combination which is described in a message in a bottle next to the chest.
The message says:
o that only the most worthy pirate shall be able to open the chest, the combination is the solution to the following puzzle: A binary sequence of length in which the only pair of consecutive ones is located at the end of the sequence is a pirate representation of a number if where denotes the -th Fibonacci number. Fibonacci numbers are defined as following: , , for each .
For example , , , where denotes a pirate representation of a number.
A pirate code is a binary sequence (without any condition on consecutive ones) that represents a sequence of positive integers. To read it we partition it in as many parts as possible that are pirate representation of some numbers (and possibly a suffix that is not a pirate entry of any number) and write those integers in a sequence. For example we partition in , the last part is not a pirate representation so we delete it and read a sequence , , .
The value of a pirate code is equal to the sum of values of decoded sequnce of positive integers. The value of previous code is .
My favourite number is the sum of values of all pirate codes of length . As that number may large, the combination to the chest is the remainder ofP modulo .
- Leonarrrdo da Pisa
If Marrrtina doesn’t manage to open the chest, her crew will not consider her worthy and they’ll make her walk the plank.
입력
In first and only line there is a positive integer n ≤ 5000.
출력
In a single line of output print numbers where -th number represents the answer to the puzzles for codes of length .
힌트
Clarification:
Codes of length are and and they both have value .
Code has value while all other codes of length have value .
Code has value , and code has value .
예제
예제 1
4
0 1 4 16