Recursion [II]


Recursion [II]

We introduce a new recursive sequence, which satisfies:

{G(0)=0G(1)=5G(n)=2×G(n1)+3×G(n2)+F(n1)n2\begin{cases} G(0) = 0 & \\ G(1) = 5 & \\ G(n) = 2\times G(n-1) + 3\times G(n-2) + F(n-1) & n \geq 2 \end{cases}

Where F(n)F(n) is the nth fibonacci number, following the previous definition.

For example, G(0),G(1),G(2),G(3),G(4)G(0), G(1), G(2), G(3), G(4) can be written as 0,5,11,39,1140, 5, 11, 39, 114

In this question, you must compute G(n)G(n) for some value nn. Since the value may be quite large, output your answer modulo 109+710^9+7.

Input

Input will contain a single integer nn

Output

Output should contain a single integer, representing G(n)mod109+7G(n) \text{mod} 10^9+7.

Constraints

  • 0n10180 \leq n \leq 10^18

Example

Input 1
5
Output 1
350

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.