N= int(input()) if N == 1: print(2) elif N%2 == 1: print(4*5**(N//2-1)*3%1000000007) else: print(4*5**(N//2-1)%1000000007)