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>
using namespace std;

int main(){

  long long i, N, Num1=10, Num2=18, Num3=8, md=1000000007, Ans;
  cin>>N;
  
  for(i=0; i<N-1; i++){
    Num1*=10;Num2*=9;Num3*=8;
    if(Num1>=md) Num1%=md;
    if(Num2>=md) Num2%=md;
    if(Num3>=md) Num3%=md;
  }
  Ans=Num1-Num2+Num3;
  if(Ans>=0){
    cout<<Ans%md<<endl;
  }else{
    cout<<Ans+md<<endl;
  }
  return 0;
}