A ternary representation is considered balanced if it has an equal number of even and odd digits (where is regarded as an even digit) and no prefix of the representation has more even digits than odd digits.
Given a number (0 < N \le 10^6), your task is to calculate the total number of balanced ternary representations of length . The result should be presented modulo 1000000009 (10^9+9).
The input consists of a single line containing the integer .
Output a single line containing the answer to the problem.
Example 1