CSES - E4590 2017 2 - Big fibonacci
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Fibonacci sequence is defined as
Fn=Fn2+Fn1F_n=F_{n-2} + F_{n-1}
with seed numbers
F1=1F_1 = 1
and
F2=1F_2 = 1.

Teemu wonders how the Fibonacci sequence behaves if he changes the seed numbers to something else. Help Teemu to investigate this matter by providing him a program for computing FnF_n. As this number may grow quickly, your program should only output result modulo 109+710^9+7.

Input

The first line of input consists of three numbers F1F_1, F2F_2 and nn, the seed numbers and the index in Fibonacci sequence.

Output

Output a single line containing FnF_n modulo 109+710^9+7.

Limit

  • 0F1F2109+70 \le F_1 \le F_2 \le 10^9+7
  • 1n10181 \le n \le 10^{18}

Example

Input:

1 3 7

Output:

29

The sequence starts {1,3,4,7,11,18,29,47,76,}\left\lbrace1, 3, 4, 7, 11, 18, 29, 47, 76, \ldots\right\rbrace.