import java.util.Scanner; import java.util.stream.IntStream; public class Main{ static IntStream REPS(int v){return IntStream.range(0,v);} static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);} static IntStream INS(int n) {return REPS(n).map(i->getInt());} static Scanner s=new Scanner(System.in); static int getInt(){return Integer.parseInt(s.next());} public static void main(String[]$){ long n=getInt(),r=4,mod=1000000007; if(n==1) { System.out.println(2); return; } r=r*modPow(5,n/2-1,mod)%mod; if(n%2==1) r=r*3%mod; System.out.println(r); } public static long modPow(long n,long p,long mod) { if(p==0) return 1; if(p==1) return n%mod; if(p%2==0) { long buf=modPow(n, p/2, mod); return buf*buf%mod; } return n*modPow(n, p-1, mod)%mod; } }