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 mod 1000000007
#define djfs first
#define akdk second
#define N 100000000
#define fo(i,m,n) for(int i=m;i<n;i++)
#define M 7
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
using ll=long long;
using ul=unsigned long long;
using pii=pair<int,int>;
using vvi=vector<vector<int>>;
using vi=vector<int>;
using pll=pair<ll,ll>;
using vsi=vector<set<int>>;
using vll=vector<ll>;

ll power(ll a,ll n){
    ll j=0;
    ll x=1;
    while(1ll<<j<=n){
        if(1ll<<j&n)
            x=(x*a)%mod;

        a=a*a%mod;
        j++;
    }

    return x;
}

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

int lb(vi &a,int x){
    int n=a.size();
    int l=0;
    int r=n-1;
    int ind=-1;
    while(l<=r){
        int mid=(l+r)/2;
        if(x>=a[mid]){
            l=mid+1;
            ind=mid;
        }
        else
            r=mid-1;

    }

    return ind+1;

}

int up(vll &a,ll x){
    int n=a.size();
    int l=0;
    int r=n-1;
    int ind=-1;

    while(l<=r){
        int mid=(l+r)/2;
        if(a[mid]>x){
            r=mid-1;
            ind=mid;
        }
        else
            l=mid+1;

    }

    return ind;
}

ll max(ll a,ll b){
    if(a>b)
        return a;
    else
        return b;

}

ll min(ll a, ll b){
    if(a>b)
        return b;
    else
        return a;

}

void yn(bool a){
    if(a)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;

}


bool isodd(int a,int b,int agx,int agy){

    return (abs(a-agx)+abs(b-agy))%2;

}
int fap(vi &par,int x){
    if(par[x]!=x)
        par[x]=fap(par,par[x]);

    return par[x];
}

void unin(vi &par,vi &rank,int x,int y){
    int px=fap(par,x);
    int py=fap(par,y);

    if(px!=py){
        if(rank[px]<rank[py])
            swap(px,py);

        par[py]=px;
        rank[px]+=rank[py];
    }
}

struct fenwick_tree
{
    vll bit;
    int n;
    fenwick_tree(int n){
        this->n=n;
        bit=vll(n+1);
    }

    void update(int idx,ll val){
        while(idx<=n){
            bit[idx]+=val;
            idx+=idx&-idx;
        }
    }

    void rupdate(int l,int r,int x){
        update(l,x);
        update(r+1,-x);
    }

    ll query(int idx){
        ll tot=0;
        while(idx){
            tot+=bit[idx];
            idx-=idx&-idx;
        }

        return tot;
    }

};


int main(){

    ll n;
    cin>>n;
    cout<<(mod+(power(10,n)-power(9,n)-power(9,n)+power(8,n))%mod)%mod<<endl;
}