St Andrews Online Judge

Climbing a Ladder

By Deyao Chen

Time: 1000 ms
Memory: 256000 kB

The code judging system is only available during contests. Check out the github repo for test cases and solutions.

Please log in.

Problem Statement

You are designing an open world game. In the game, a character can climb a ladder to move up. In each move, the character can either climb up one unit by pressing the up arrow, or leap up 33 moves by pressing x. Note that if there is less than 33 units left of the ladder, the player can still choose to leap.

Now you want the game to drop a loot whenever the player does a specific combination of moves and leaps (Think of this as a sort of hidden cheat code or hidden combo). Obviously, the higher the ladder, the more unlikely the player will randomly stumble across the specific combination. So you decide to count the number of combinations of moves given the height of a ladder to gauge the difficulty of achieving the hidden combo.

Constraints

1n10151 \le n \le 10^{15}.

Subtask 1 (20%)

1n201 \le n \le 20.

Subtask 2 (20%)

1n1031 \le n \le 10^{3}.

Subtask 3 (20%)

1n1051 \le n \le 10^{5}.

Subtask 4 (40%)

No more constraints.

Input

Input one number, nn, the height of the ladder.

Output

Output one number, aa, the remainder of the number of combinations of moves divided by 109+710^{9} + 7.

Examples

Input

5

Output

9

Explanation

The ladder is 55 units high, the number of combinations of moves is 99:

  • climb ×5× 5
  • climb ×4× 4, leap
  • climb ×3× 3, leap
  • climb ×2× 2, leap
  • climb, leap, climb
  • climb, leap, leap
  • leap, climb, climb
  • leap, climb, leap
  • leap, leap