def main(): N = int(input()) MOD = 1000000007 ans = (4 * pow(10, N, MOD) - 1) % MOD if ans % 3 == 0: print(ans // 3) elif ans % 3 == 1: print((ans + MOD) // 3) else: print((ans + 2 * MOD) // 3) if __name__ == "__main__": main()