long n,m=1e9+7;long p(a,n){return n?p(1L*a*a%m,n/2)*(n%2?a:1)%m:1;}main(){scanf("%ld",&n);printf("%d",n/2?(n%2*8+4)*p(5,n/2-1)%m:2);}