#Q225. 「一本通 6.5 练习 1」Fibonacci

「一本通 6.5 练习 1」Fibonacci

Description

Original Source: POJ 3070

We know the Fibonacci sequence is defined as F0=0F_0=0, F1=1F_1=1, and Fn=Fn1+Fn2F_n=F_{n-1}+F_{n-2} for n2n \geq 2.

Compute Fnmod104F_n \bmod 10^4.

Input Format

Multiple test cases. Each case consists of a single line containing an integer nn.

Input ends with 1-1.

Output Format

For each test case, output Fnmod104F_n \bmod 10^4.

Sample 1

0
9
999999999
1000000000
-1

0
34
626
6875

Constraints and Notes

For all test cases, 0n1090 \le n \le 10^9.