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-----
2

-----Sample Output-----
2

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

Difficulty: introductory

Starter code:

Solutions:
n = int(input())
mod = 10**9 + 7
all09 = ((2 * 10**n) % mod - (2 * 9**n) % mod) % mod
of09 = ((10**n) % mod - 8**n % mod) % mod
print((all09-of09)%mod)

#! /usr/bin/python3

n = int(input())
mod = 10**9+7
ans = pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod)
ans = (ans + mod) % mod
print(ans)


N=int(input())
a = (10**N - 9**N - 9**N + 8**N) % (10**9 + 7)
print(a)

N = int(input())
val = 7 + 10 ** 9

print(((pow(10, N, val) - pow(9, N, val) * 2 + pow(8, N, val)) %val ))


import numpy as np

def __starting_point():

    input_str = input()
    n = int(input_str)
    peterns = 10**n
    a0_subset = peterns - 9**n
    a9_subset = peterns - 9**n
    anti_subset = 8**n
    ans = a0_subset + a9_subset + anti_subset - peterns
    ans %= (10**9 + 7)
    print(ans)
__starting_point()

N = int(input())
print((10 ** N + 8 ** N - 9 ** N - 9 ** N) % 1000000007)

import sys
def Ii():return int(sys.stdin.readline())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

n = Ii()
num = 10
mod = 10**9+7
ans = (pow(num,n,mod)-pow(num-1,n,mod)-pow(num-1,n,mod)+pow(num-2,n,mod))%mod
print(ans)

#a,b,c,d = map(int, input().split())
n = int(input())
ans = (10**n - 9**n*2 + 8**n) % 1000000007
print(ans)


MOD = 10**9+7

N = int(input())

cnt = (pow(10, N, MOD) - 2*pow(9, N, MOD) + pow(8, N, MOD))
cnt = cnt % MOD

print(cnt)

n = int(input())
mod = 10**9 + 7

print((10**n - 2*9**n + 8**n)%mod)

n = int(input())
print((10**n - 9**n - 9**n + 8**n) % 1000000007)

N=int(input())
U=10**N
x1=U-9**N
x2=U-8**N
Y=2*x1-x2
print(Y%(10**9+7))

n = int(input())
ans = 10**n - 2*9**n + 8**n

print(ans%(10**9+7))

def main():
    N = int(input())
    
    mod = 10**9 + 7
    ans = pow(10, N, mod) -2*pow(9, N, mod) + pow(8, N, mod)
    print(ans % mod)
    
        
            


def __starting_point():
    main()
__starting_point()

n = int(input())
print((10**n-9**n*2+8**n)%(10**9+7))

n = int(input())
p = 10**9+7
ans = pow(10,n,mod=p) - 2*pow(9,n,mod=p) + pow(8,n,mod=p)
print(ans%p)

#abc178c
n=int(input())
print(((10**n-2*9**n+8**n)%(10**9+7)))


N = int(input())
print((10**N - (9**N + 9**N - 8**N))%((10**9)+7))

N=int(input())
print((10**N-9**N-9**N+8**N)%(10**9+7))

N, = map(int, input().split())
re = 0
re = 10 ** N - ((2 * 9 ** N) - 8 ** N)
print(re%(10**9+7))

N = int(input())
mod = 10**9 + 7
ans = pow(10,N,mod) - pow(9,N,mod)*2 + pow(8,N,mod)
print(ans%mod)

N = int(input())
if N < 2:
    print(0)
else:
    print(((10**N-9**N)*2-(10**N-8**N))%(10**9+7))

# -*- coding utf-8 -*-

MOD = 10 ** 9 + 7

N = int(input())

ans = pow(10, N, MOD) - (pow(9, N, MOD) * 2 - pow(8, N, MOD))

ans %= MOD
print(ans)


mod = 10**9+7
n=int(input())
ans = (10**n - 9**n - 9**n + 8**n)%mod
print(ans)

N = int(input())
ans = (10 ** N - 2 * (9 ** N) + (8 ** N)) % (10 ** 9 + 7)

print(ans)

N = int(input())
m = 1000000007
print((pow(10, N, m) - 2 * pow(9, N, m) + pow(8, N, m)) % m)

num = int(input())
result = 2*(10**num - 9**num) - (10**num - 8**num)
print(str(result%1000000007))

N = int(input())

MOD = 10**9 + 7

print((10**N - 2 * 9**N + 8**N)%MOD)

#! /usr/bin/python3

n = int(input())
mod = 10**9+7
ans = (pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod)) % mod
print(ans)


# 0を含まない: 9 ** n
# 9を含まない: 9 ** n
# 0と9を含まない: 8 ** n
# 0または9を含まない: 2 * 9 ** n - 8 ** n
# 0と9を含む: 10 ** 9 - 2 * 9 ** n + 8 ** n
def pow(a, x):
  if x == 0:
    return 1
  else:
    y, r = divmod(x, 2)
    sq = pow(a, y)
    if r == 1:
      return (sq * sq * a) % (10 ** 9 + 7)
    else:
      return (sq * sq) % (10 ** 9 + 7)
    
def __starting_point():
  n = int(input())
  print((pow(10, n) - 2 * pow(9, n) + pow(8, n)) % (10 ** 9 + 7))
__starting_point()

n = int(input())
ans = 0

if n == 1:
    ans = 0
else:
    ans = ((10**n)%(10**9+7) - ((2*9**n)%(10**9+7) - (8**n)%(10**9+7)))%(10**9+7)

print(ans)

N = int(input())
ans = (10**N - 9**N - 9**N + 8**N)%(int(1e9+7))
print(int(ans))

MOD = 10**9 + 7
def an(a, n):
    ans = 1
    for i in range(N):
        ans = ans*a%MOD
    return ans%MOD


N = int(input())



A_n0 = an(9,N)
#A_n9 = an(9,N)
A_n0n9 = an(8, N)



ans = 10**N%MOD - (2*A_n0%MOD - A_n0n9)
print(ans%MOD)

## C
import sys
n = int(input())
print((10**n - 9**n *2 + 8**n)%(10**9+7))

n = int(input())
#x, k, d = map(int, input().split())
#al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]

mod = 10**9+7


def modpow(a, n, mod):
    # a^nをmodでわったあまり 二分累乗法O(logn)
    res = 1
    while n > 0:
        if n & 1:
            res = (res*a) % mod
        a = (a*a) % mod
        n = n >> 1
    return res


ans = (modpow(10, n, mod)-modpow(9, n, mod) -
       modpow(9, n, mod)+modpow(8, n, mod)) % mod
print(ans)


n = int(input())

mod = 10 ** 9 + 7
ans = 10 ** n + 8 ** n - 2 * 9 ** n
print((ans % mod))


n = int(input())

print((10**n - 2*9**n + 8**n)%(10**9+7))

# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    n = int(input())
    mod = 10 ** 9 + 7

    # See:
    # https://www.youtube.com/watch?v=yLkJZXkB6D0&feature=youtu.be
    # KeyInsight:
    # 包除原理

    # ◯
    # 全体 - 余事象
    # nの小さい値で愚直に数えようとした

    # △
    # 条件を丁寧に整理する、ベン図を活用する
    # 全体: 10 ^ n
    # 0を含まない: 9 ^ n
    # 9を含まない: 9 ^ n
    # 0, 9を含まない: 8 ^ n
    # 0, 9のうち少なくとも片方は含まない: 9 ^ n + 9 ^ n - 8 ^ n
    ans = pow(10, n, mod)
    ans -= pow(9, n, mod)
    ans -= pow(9, n, mod)
    ans += pow(8, n, mod)

    print((ans % mod))


def __starting_point():
    main()

__starting_point()

n=int(input())
result=(10**n - 2*9**n + 8**n) % (10**9 +7)
print(result)

mod = 10**9 + 7
N = int(input())
ans = pow(10,N,mod)
ans -= 2 * pow(9,N,mod)
ans += pow(8,N,mod)
ans %= mod

print(ans)

def c178(n):

    ans = 0
    mod = 10**9+7

    ans = (10**n - 2*(9**n) + 8**n)

    return ans % mod

def main():
    n = int(input())
    print(c178(n))

def __starting_point():
    main()
__starting_point()

N = int(input())
 
print((10**N - 2 * (9**N) + (8 ** N))%(10 ** 9 + 7))

N=int(input())
x=10**N-9**N-9**N+8**N
print(x % (10**9+7))

import numpy as np
base = 10**9 + 7
def pw(x, n):
  if n == 0:
    return 1
  elif n == 1:
    return x
  else:
  	return ((pw(x, n // 2)**2 % base) * pw(x, n % 2) % base)
  
n = int(input())
print((pw(10, n) - 2*pw(9, n) + pw(8, n)) % base)

n = int(input())

answer = (10 ** n) - (9 ** n) - (9 ** n) + (8 ** n)
    
answer = answer % (10 ** 9 + 7)
print(answer)

MOD = 10**9 + 7

N = int(input())

a1 = pow(10, N, MOD)
a2 = 2 * pow(9, N, MOD)
a3 = pow(8, N, MOD)
ans = (a1 - a2 + a3) % MOD

print(ans)

N = int(input())
print((10**N - (9**N)*2 + 8**N)%(10**9+7))

N = int(input())
MOD = 10 ** 9 + 7
print((pow(10, N, MOD) - (pow(9, N, MOD) + pow(9, N, MOD) - pow(8, N, MOD) )) % MOD)

m = 1000000007

N = int(input())

print((pow(10, N, m) - pow(9, N, m) * 2 + pow(8, N, m)) % m)

from scipy.special import perm
N = int(input())
mod=1000000007
ans = 10**N - 9**N - 9**N +8**N
ans %= mod
print(ans)

# -*- coding: utf-8 -*-
n=int(input())
p=10**9+7
k=(10**n)%p
l=(2*9**n)%p
m=(8**n)%p
ans=(k-l+m)%p
print(ans)

n = int(input())

mod = 10 ** 9 + 7
ans = pow(10, n, mod) + pow(8, n, mod) - 2*pow(9, n, mod)
print((ans % mod))


##C - Ubiquity
N = int(input())
ans = 10**N - 2*(9**N) +8**N
print(ans%(10**9+7))

n=int(input())
m=1000000007;
print((pow(10,n,m)-2*pow(9,n,m)+pow(8,n,m))%m)

N = int(input())
m = 10**9+7
print((pow(10, N, m) - 2 * pow(9, N, m) + pow(8, N, m)) % m)

n = int(input())
mod = 1000000007

print((pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod))%mod)

n = int(input())
mod = 10**9 + 7

ans = pow(10, n, mod)
ans -= 2 * pow(9, n, mod)
ans += pow(8, n, mod)

print(ans % mod)

N = int(input())
wari = 7 + 10 ** 9

print(
    (pow(10, N, wari) - pow(9, N, wari) * 2 + pow(8, N, wari)) %wari
)

n = int(input())
mod = 10**9 + 7
l = [8,2,0]
for i in range(n-1):
    a,b,c = l
    l[0] = a*8 % mod
    l[1] = (b*9 + a*2)%mod
    l[2] = (b + c*10)%mod
print(l[2])

N = int(input())

M = 10**9+7

a = 10**N % M
b = 2*(9**N) % M
c = 8**N % M

print((a-b+c)%M)

import sys

def solve():
    N = int(input())
    mod = 7 + 10 ** 9
    total = pow(10, N, mod)
    noZeroOrNine = pow(9, N, mod)
    noZeroAndNine = pow(8, N, mod)
    print((total - 2 * noZeroOrNine + noZeroAndNine) % mod)


    return 

def __starting_point():
    solve()
__starting_point()

N = int(input())
ans = 10 ** N - 2 * 9 ** N + 8 ** N
ans %= (10 ** 9 + 7)
print(ans)

import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
mod = 10**9 + 7

#--maincode----------------
n = ini()
ans = (10**n)
ans -= (9**n)*2
ans += (8**n)
print((ans)%mod)

N = int(input())
mod = 10 ** 9 + 7

ans = (10 ** N) % mod - ((9 ** N) % mod * 2) + (8 ** N) % mod
ans %= mod
print(ans)


import math
p  = 10**9+7
n = int(input())

print(((10**n)%p-(9**n)%p-(9**n)%p+(8**n)%p)%p)

n=int(input())
m=10**9+7
u=pow(10,n,m)
a=(u-pow(9,n,m))%m
b=(u-pow(8,n,m))%m
ans=(a+a-b)%m
print(ans)

N = int(input())
if N == 1:
    print(0)
    return
ans = 10**N - 9**N - 9**N + 8**N
print(ans%(10**9+7))

n=int(input())
ans=10**n-9**n*2+8**n
ans%=10**9+7
print(ans)

n = int(input())

n_all = 10**n
n_e0  = 9**n
n_e9  = 9**n
n_e09 = 8**n

ans = ( n_all -n_e0 -n_e9 +n_e09 )%( 10**9+7 )
print(ans)


def main():
    N = int(input())
    all_non_zero, all_non_nine = 9 ** N, 9 ** N
    all_non_zeronine = 8 ** N
    any_zeronine = all_non_zero + all_non_nine - all_non_zeronine

    ans = 10 ** N - any_zeronine
    print((ans % (10 ** 9 + 7)))


def __starting_point():
    main()

__starting_point()

import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


def main():
    n = int(input())
    r = (10**n + 8**n - 2 * (9**n)) % (10**9+7)
    print(r)


def __starting_point():
    main()

__starting_point()

n = int(input())
print((10**n - 2*9**n + 8**n) % (10**9 + 7))

n = int(input())
print(((10 ** n + 8 ** n - 9 ** n * 2) % (10 ** 9 + 7)))


def __starting_point():
  n=int(input())
  print(((10**n-(2*(9**n))+8**n)%(10**9+7)))

__starting_point()

N=int(input())

mod=10**9+7

ans=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)
print(ans%mod)

N = int(input())

ans = 10 ** N - 2 * (9 ** N) + 8 ** N

print((ans % (10**9 + 7)))


n = int(input())
ans = (10 ** n - 2 * (9 ** n) + 8**n) %  (10**9 + 7)
print(ans)

#C
n = int(input())
mod = 10e8 + 7
def powmod(x, y):
    res = 1
    for _ in range(y):
        res *= x
        res %= mod
    return res
ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n)

ans %= mod
ans=int(ans)
print(ans)

N=int(input())
sum=10**N
sum-=9**N
sum-=9**N
sum+=8**N
print(sum%((10**9)+7))

N = int(input())
print((10**N - 9**N - 9**N + 8**N) % (10**9 + 7))

N=int(input());print((10**N-2*9**N+8**N)%(10**9+7))

n = int(input())
ans = 10**n-2*pow(9,n)+8**n
k = pow(10,9)+7
print(ans%k)

N = int(input())
print((pow(10, N) - (2 * pow(9, N) - pow(8, N))) % (pow(10, 9) + 7))

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


n = ri()
print(((10**n - 2*9**n + 8**n)%mod))


N = int(input())

mod = 10**9+7
A = 10**N - (9**N * 2 - 8**N)

print(A%mod)

N=int(input())

MOD=10**9+7

print((pow(10,N,MOD) - 2*(pow(9,N,MOD)) + pow(8,N,MOD))%MOD)

n = int(input())
m = 10 ** 9 + 7
print((10 ** n - 2 * 9 ** n + 8 ** n) % m)

mod = 10**9 + 7
n = int(input())
print((10**n - 2 * (9**n) + 8**n) % mod)

mod = 10**9+7
n = int(input())
ans = pow(10, n, mod)
ans -= 2 * pow(9, n, mod)
ans += pow(8, n, mod)
ans %= mod
print(ans)

n = int(input())
m = 10**9 +7

x = 10**n % m
y = 9**n % m
z = 8**n % m

print((x - y*2 + z)% m)

n = int(input())
waru = 1000000000+7

def kaijo(x, n):
  kake = 1
  for i in range(n):
    kake = (kake * x) % waru
  return kake

amari = kaijo(10, n) -2*kaijo(9, n) + kaijo(8, n)
amari %= waru
print(amari)

#１０＾９＋７で割った余りを出力
n = int(input())
mod = 10**9+7
#pow(5,2) = 25 べき乗計算 pow()の第三引数は剰余
ans = pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod)
print((ans%mod))


n = int(input())
mod = 10**9+7
print(((10**n-9**n)*2 - (10**n-8**n))%mod)

n = int(input())
mod = 10**9+7
if n <= 1:
    print((0))
    return
print(((pow(10, n, mod)-2*pow(9, n, mod)+pow(8, n, mod)) % mod))


N = int(input())
MOD = 10 ** 9 + 7
All = (10 ** N) % MOD
nine_all = (9 ** N) % MOD
eight_all = (8 ** N) % MOD
ans = All - (2 * nine_all - eight_all)
ans %= MOD
print(ans)

N = int(input())
MOD = 10**9+7
print((10**N-(9**N+9**N-8**N))%MOD)

#(全ての場合) - {(0が存在しないとき) + (9が存在しないとき) - (0と9がともに存在しないとき)}
n = int(input())

MOD = 10 ** 9 + 7

print((pow(10,n) % MOD  - (9**n * 2 - 8 ** n) % MOD )%MOD)

#! /usr/bin/python3

n = int(input())
mod = 10**9+7
ans = pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod)
ans %= mod
print(ans)


n = int(input())
mod = 10**9+7
ans = pow(10, n, mod)-2*pow(9, n, mod)+pow(8, n, mod)
ans %= mod
print(ans)

mod = 10**9 + 7
n = int(input())
print(((pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)) % mod))