Fibonacci sequence#1086

Fibonacci sequence

1 second
64 megabytes
Medium

F_k (k = -\infty, \ldots, +\infty) is an infinite sequence of integers, which satisfies the Fibonacci condition:

F_k = F_{k-1} + F_{k-2}

for any integer .

You are given , F_i, , F_j, such that i \neq j. Find F_n.

Input

The first line contains the integers , F_i, , F_j, .

-1000 \leq i, j, n \leq 1000,\quad -2000000000 \leq F_k \leq 2000000000 \quad (k = \min(i, j, n), \ldots, \max(i, j, n))

Output

Output the single number F_n.

Examples

Example 1

Loading
Loading