Problem:
Score : 300 points

Problem Statement

How many integer sequences A_1,A_2,\ldots,A_N of length N satisfy all of the following conditions?

0 \leq A_i \leq 9

There exists some i such that A_i=0 holds.

There exists some i such that A_i=9 holds.

The answer can be very large, so output it modulo 10^9 + 7.

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer modulo 10^9 + 7.

Sample Input 1

2

Sample Output 1

2

Two sequences \{0,9\} and \{9,0\} satisfy all conditions.

Sample Input 2

1

Sample Output 2

0

Sample Input 3

869121

Sample Output 3

2511445

Solution in C# (Mono-mcs 6.8.0.105) (judge verdict: Wrong Answer)

using System;
using System.Collections;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Threading.Tasks;


class Program
{
	//繰り返し２乗法
	//N^Pをmodで割った余りを計算
	static long PowMod(long N, long P, long mod){
		//0乗の場合
		if(P == 0){
			return 1;
		}
		//指数が偶数の場合
		else if(P % 2 == 0){
			//指数を半分にして計算したもの同士を掛け合わせる
			long half = PowMod(N, P/2, mod);
			return half * half % mod;
		}
		//奇数の場合
		else{
			//指数を一つ減らしたものに、Nをかける
			long before = PowMod(N, P-1, mod);
			return N * before % mod;
		}
	}

	//Main
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());

		long mod = 1000000007;

		//全て0~9の組み合わせの数
		long ans = PowMod(10, N, mod);

		//うち、0がない組み合わせ（9がないのも数は同じ）
		long non1 = PowMod(9, N, mod);

		//うち、0も9もない組み合わせ
		long non2 = PowMod(8, N, mod);

		ans -= non1;
		ans %= mod;
		ans -= non1;
		ans %= mod;
		ans += non2;
		ans %= mod;

		Console.WriteLine(ans);
	}
}