import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static long mod_pow(long a, long x){ if(x == 0){ return 1; } else if(x == 1){ return a; } else if(x % 2 == 1){ return (mod_pow(a, x - 1) * a) % MOD; } else{ final long t = mod_pow(a, x / 2); return (t * t) % MOD; } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long N = sc.nextLong(); if(N == 1){ System.out.println(2); }else if(N == 2){ System.out.println(4); }else if(N % 2 == 1){ final long run = (N - 3) / 2; final long x = mod_pow(5, run); System.out.println((3 * x * 4) % MOD); }else{ final long run = (N - 4) / 2; final long x = mod_pow(5, run); System.out.println((5 * x * 4) % MOD); } } }