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