We’re preparing your current view and syncing the latest data.
You are given three integers a, b, and n. Define a sequence f such that f(1) = a, f(2) = b, and for all i ≥ 3, f(i) = f(i-1) - f(i-2). Your task is to find the value of f(n) modulo 10^9 + 7.
The first and only line of input contains three space-separated integers a, b, and n.
Print the value of f(n) modulo 10^9 + 7.
1 ≤ a, b ≤ 10^9 1 ≤ n ≤ 10^9
Example 1
Input
3 4 1
Output
3
Explanation
f(1) = a = 3
Example 2
Input
3 4 2
Output
4
Explanation
f(2) = b = 4
Example 3
Input
3 4 3
Output
1
Explanation
f(3) = f(2) - f(1) = 4 - 3 = 1