1399. Print

When lwh took part in the big company interview, the interviewer gave a hard question to lwh, lwh felt it too simple, so he threw the question to you, the question is: You have a grid of size n \times 3 and you want to paint each cell of the grid with exactly one of the three colours: Red, Yellow or Green while making sure that no two adjacent cells have the same colour (no two cells that sharevertical or horizontal sides have the same colour).

输入

Only a positive integer n \ (1≤n≤5000) the number of rows of the grid.

输出

Return the number of ways you can paint this grid. As the answer may grow large, the answer must be computed modulo 10^9+ 7.

样例

标准输入 复制文本
1
标准输出 复制文本
12

来源

SCNUCPC 2020 现场赛

登录以提交代码。
单点时限 1 秒
内存限制 256 MB
提交 16
通过 10