#t305. 涂色问题

涂色问题

Coloring Problem

Problem Background

Special for beginners, ^_^

Problem Description

This is a coloring problem. There is now a grid with 3 rows and nn columns. You need to color the grid using 3 colors, ensuring that adjacent cells have different colors. How many coloring schemes are there in total? Output the answer modulo 109+710^9 + 7.

Input Format

One positive integer nn (1≤n≤1091 \le n \le 10^9).

Output Format

One integer: the number of coloring schemes.

Sample Input 1

1

Sample Output 1

12

Sample Input 2

2

Sample Output 2

54

Constraints

1s, 1024KiB for each test case.