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++ (GCC 9.2.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
#define ll long long
#define vi vector <int>
#define vl vector <ll>
#define dl pair <ll, ll>
#define ii pair <ll, ll>
#define vii vector <ii>
#define graph vector <vector <int> >
#define REP(a, b) for (int i = a; i < b; i++)
#define REP2(a, b) for (int j = a; j < b; j++)
#define REPS(a, b, c) for (int i = a; i < b; i += c)
#define mod 1000000007

using namespace std;
 
int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
 
    ll n;
    cin >> n;
    ll ans = 1;
    for (ll i = 0; i < n; i++) {ans *= 10; ans %= mod;}
    ll temp1 = 1; //no llevan ni 9 ni 0
	ll temp2 = 1; //llevan 9 o 0
	ll temp3 = 1; //levan exactamente un 9 o un cero
	for (ll i = 0; i < n; i++) {temp1 *= 8; temp1 %= mod;}
	for (ll i = 0; i < n; i++) {temp2 *= 9; temp2 %= mod;}
	temp3 = ((temp2 - temp1 + mod) * 2) % mod;
	ans = (ans - temp1 + mod - temp3 + mod) % mod;
    cout << ans << "\n";
    return 0;
}