For every given pair of natural numbers n and m,
compute Fn modm,
where Fn is the n-th Fibonacci number (starting at 0).
Input
The input consists of several pairs of n and m.
Assume 0 ≤ n ≤ 109
and 2 ≤ m ≤ 103.
Output
For every given pair, print Fn modm.
Hint
Consider the problem .
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.