import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) MOD = 10**9 + 7 def f(N): if N == 1: return 2 n = N // 2 x = pow(5, n-1, MOD) * 4 if N & 1: x *= 3 return x % MOD # f(2), f(3), f(57), f(864), f(1) print(f(N))