mod = 10**9 + 7 N = int(input()) if N == 1: ans = 2 else: ans = 4 * pow(5, N//2 - 1, mod) % mod if N % 2: ans = ans * 3 % mod print(ans)