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: Wrong Answer)

#include <bits/stdc++.h>
#define INF 1e9
#define INFLL 1ull<<60u
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
typedef long long ll;


// (a^n)%modを求めるライブラリ
long long modpow(long long a, long long n) {
    long long res = 1;
    static const int mod = 1e9+7;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

void solve() {
    ll N; cin >> N;
    ll p = modpow(10,N);
    ll q = 2 * (modpow(9,N));
    p-=q;
    if (p < 0) p += INF + 7;
    cout << p << endl;
}

void solve2() {
    ll N; cin >> N;
    ll p = modpow(9,N) * 2;
    ll q = modpow(8,N);
    ll t = p-q;
    if (t < 0) t+= INF+7;
    ll x = modpow(10,N) - t;
    if (x < 0) x += INF + 7;
    cout << x << endl;
}

int main() {
    solve2();
    return 0;
}