import java.io.*; import java.util.Scanner; public class Main_yukicoder793_1 { private static Scanner sc; private static Printer pr; private static void solve() { final int MOD = 1_000_000_007; long n = sc.nextLong(); long ans = (4 * modPow(10, n, MOD) - 1) % MOD * modPow(3, MOD - 2, MOD) % MOD; pr.println(ans); } static long modPow(long a, long n, int MOD) { long loop = n; long ret = 1; long x = a % MOD; while (loop > 0) { if (loop % 2 == 1) { ret = ret * x % MOD; } x = x * x % MOD; loop /= 2; } return ret; } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }