#include<bits/stdc++.h>
#define MOD 1000000007
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll ppow(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1)res=(res*a)%MOD;
		a=(a*a)%MOD;
		b>>=1;
	}
	return res;
}
int main() {
	ll n;scanf("%lld",&n);
	if(n==1){
		puts("2");return 0;
	}
	if(n==2){
		puts("4");return 0;
	}
	if(n%2==1){
		printf("%lld\n",(4*ppow(5,n/2-1)*3)%MOD);
	}
	else{
		printf("%lld\n",(4*ppow(5,n/2-1))%MOD);
	}
}