N=int(input()) Mod=1000000007 q,r=divmod(N,2) if N==1: print(2) elif r: print((4*3*pow(5,q-1,Mod))%Mod) else: print((4*pow(5,q-1,Mod))%Mod)