import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n = int(readline()) mod = 10 ** 9 + 7 if n == 1: print(2) else: print(4 * pow(5, n // 2 - 1, mod) * (3 if n % 2 == 1 else 1) % mod)