import java.util.Arrays; import java.util.Scanner; public class Main { final long MODULO = 1_000_000_000 + 7; void run() { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); if (n == 1) { System.out.println(2); return; } if (n % 2 == 0) { System.out.println(4 * pow(5, n / 2 - 1) % MODULO); } else { System.out.println(4 * pow(5, n / 2 - 1) * 3 % MODULO); } } long pow(long a, long n) { long ret = 1; for (; n > 0; n >>= 1, a = (a * a) % MODULO) { if (n % 2 == 1) { ret = ret * a % MODULO; } } return ret; } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } public static void main(String[] args) { new Main().run(); } }