Lindra has found the formula to eternal life! Unfortunately, they have also proved that no closed form exists, and therefore they are not too sure how to solve it. The formula is recursive, of the form F(0)=a,F(1)=b,F(n)=a×Fn−1+b×Fn−2F(0) = a, F(1) = b, F(n) = a \times F_{n-1} + b \times F_{n-2}. If they are able to find the value of F(k)F(k), Lindra will surely be able to achieve immortality. As Indra's PHD supervisor, can you help them find this value?

Since this value can be quite large, output it modulo 1000000007.

Input Format

The input will consist of the three integers from the description on one line, aa, bb and kk.

Output Format

The output should consist of a single integer, the value of F(k)F(k) modulo 1e9+71e9+7.

Sample Input

Input 1
1 2 4

Sample Output

Output 1
16

Sample Explanation

This sample corresponds to the powers of two. F(0) = 1, F(1) = 2, F(2) = 4, F(3)=8, F(4)=16, etc

Constraints

1≤a,b≤1e31 \le a,b \le 1e3

1≤k≤1e51 \le k \le 1e5

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.