LearnPy Hub
← Arena
AdvancedRating 1600

Knight on a Phone Pad

A knight hops on a phone keypad (digits 0–9 in the usual layout, * and # not allowed). Count the different numbers of length n it can dial (it may start on any digit), modulo 1 000 000 007.

Input

One integer n (1 ≤ n ≤ 10⁵).

Output

One integer.

Sample 1

Input
1
Output
10

Sample 2

Input
2
Output
20
solution.py
Output appears here
Knight on a Phone Pad · Python Arena problem · LearnPy Hub