long n,M=1e9+7; long p(a,b)long a;{return b?p(a*a%M,b/2)*(b%2?a:1)%M:1;} main() { scanf("%ld",&n); printf("%ld",n>2?p(5,n-3>>1)*4*(n%2?3:5)%M:n>1?4:2); }