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 (Python):
def resolve():
  N = int(input())
  base = 10**9+7

  if N == 1:
    print(0)
    return True

  ten = pow(10, N, base)
  nine = pow(9, N, base) * 2
  eight = pow(8, N, base)

  print((ten - nine + eight)%base)

if __name__ == "__main__":
  resolve()

Solution (Python):
def resolve():
    mod = 10 ** 9 + 7
    n = int(input())
    dp = [0] * 4
    dp2 = dp[:]
    dp[0] = 1
    for _ in range(n):
        dp2[0] = dp[0] * 8
        dp2[1] = dp[0] + dp[1] * 9
        dp2[2] = dp[0] + dp[2] * 9
        dp2[3] = dp[1] + dp[2] + dp[3] * 10
        dp = [x % mod for x in dp2]
    print(dp[3])


if __name__ == '__main__':
    resolve()

Solution (Python):
n = int(input())
MOD = 1000000007
ans = 10 ** n - 2*(9 ** n) + (8 ** n)
ans %= MOD
print(int(ans))

Solution (Python):
n=int(input())
if n==1:
    print(0)
elif n==2:
    print(2)
else:
    x=10**n-2*(9**n)+8**n
    print(x%(10**9+7))

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

Solution (Python):
mod =10**9 + 7
N=int(input())
a=10**N
b=9**N
c=8**N
print((a-(2*b)+c)%mod)

Solution (Python):
n=int(input()) 
ans = 0

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

Solution (Python):
M = 10**9+7
N = int(input())
print((pow(10,N,M)-pow(9,N,M)-pow(9,N,M)+pow(8,N,M))%M)

Solution (Python):
n=int(input())

if n==1:
    print(0)
    exit(0)

mod = (10**9) +7

ans=pow(10,n)

a=pow(9,n)
b=pow(8,n)

ans=(ans-2*a+b)%mod

print(ans)

Solution (Python):
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
import itertools
import math
from operator import mul
from functools import reduce

mod = 10 ** 9 + 7

n = I()
if n < 2:
    ans = 0
elif n == 2:
    ans = 2
else:
    ans = 0
    a = pow(10, n, mod)
    b = pow(9, n, mod) * 2
    c = pow(8, n)
    ans = (a-b+c) % mod

print(ans)

Solution (Python):
import sys
import numpy as np
import math  
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate 
import bisect 
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache 
mod = 10**9 + 7
INF = 10**9 + 7
from operator import mul
from functools import reduce

def main():
    n = int(input())    
    ans = (pow(10, n, mod=mod) -(pow(9, n, mod=mod) + pow(9, n, mod=mod) - pow(8, n, mod=mod))) % mod
    print(ans)
    return 0

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
mod = 10**9+7
no1 = 1
no19 = 1
ans = 1
for i in range(N):
  no1*= 9
  no1 %= mod
  no19 *= 8
  no19 %= mod
  ans *= 10
  ans %= mod
print((ans - no1*2 + no19)%mod)

Solution (Python):


mod = 10 ** 9 + 7
def main(N):
    print((10 ** N - (9 ** N) * 2 + (8 ** N)) % mod)


if __name__ == '__main__':
    N = int(input())
    main(N)

Solution (Python):
n = int(input())
if n == 1:
    print(0)
else:
    t = 10**9 + 7
    a = (10**n)
    b = (8**n)
    c = (9**n)
    d = 2 * (c-b)
    print((a-b-d)%t)

Solution (Python):
N = int(input())

mod = 10 ** 9 + 7
nn = 10 ** N
nm = (9 ** N) + (9 ** N) - (8 ** N)
a = (nn -nm) % mod
print(a)

Solution (Python):
N = int(input())

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

print(ans)

Solution (Python):
N = int(input())

mod = 10 ** 9 + 7

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

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

Solution (Python):
N = int(input())

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

Solution (Python):
N = int(input())
 
MOD = 10**9 + 7
 
if N==1:
    print(0)
elif N==2:
    print(2)
else:
    ans = pow(10,N,MOD) - 2*pow(9,N,MOD) + pow(8,N,MOD)
    ans = ans%MOD
    print(ans)

Solution (Python):
import sys
N = int(input())
if(N==1):
  print(0)
  sys.exit()
elif(N==2):
  print(2)
  sys.exit()
else:
  ans = 10**N + 8**N
  d = 2*9**N
  ans -= d
  print(ans%(10**9+7))

Solution (Python):
MOD = 10**9+7


def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


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

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

Solution (Python):
def main():
    from sys import stdin

    readline = stdin.readline

    N=int(readline().rstrip())

    result = (10 ** N - 9 ** N - 9 ** N + 8 ** N) % ( 10 ** 9 + 7 )

    print(result)

main()

Solution (Python):
def main():
    N = int(input())
        
    A = 1
    countA = 0
    for i in range(N):
        A = (A*10)%(10**9 + 7)
        
    B = 1
    countB = 0
    for i in range(N):
        B = (B*9)%(10**9 + 7)
        
    C = 1
    countC = 0
    for i in range(N):
        C = (C*8)%(10**9 + 7)
        
    ans = (A - 2*B + C)%(10**9 + 7)
        
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
if n == 1:
    print(0)
else:
    t = 10**9 + 7
    a = (10**n)
    b = (8**n)
    c = (9**n)

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

Solution (Python):
n = int(input())
x = 10**n - 2*(9**n) + 8**n

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

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())


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

Solution (Python):
n = int(input())
c10n = 1
c8n = 1
c9n = 1

mod = 10**9+7
for i in range(n):
    c10n *= 10
    c10n %= mod
for i in range(n):
    c8n *= 8
    c8n %= mod
for i in range(n):
    c9n *= 9
    c9n %= mod

ans = (c10n - c9n)*2 - (c10n - c8n)
ans %= mod
print(ans)

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    num = 10**9 + 7
    if n == 1:
        print(0)
    else:
        ans = 10**n -2*9**n + 8**n
        ans %= num
        print(ans)
main()

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

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

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

Solution (Python):
n = int(input())

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

Solution (Python):




import sys









MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

class Combination:
    def __init__(self, n, p):
        self.n = n
        self.p = p
        self.note = [1, 1]
        self.noteinv = [1, 1]
        self.inv = [0, 1]
        self.calc()

    def calc(self):
        for i in range(2, self.n + 1):
            self.note.append((self.note[-1] * i) % self.p)
            self.inv.append((-self.inv[self.p % i] * (self.p // i)) % self.p)
            self.noteinv.append((self.noteinv[-1] * self.inv[-1]) % self.p)
    
    def nCr(self, n, r):
        n = self.n
        if r < 0 or n < r:
            return 0
        r = min(r, n - r)
        return (self.note[n] * self.noteinv[r] * self.noteinv[n - r]) % self.p


def Main():
    n = read_int()
    if n == 1:
        print(0)
        exit()
    elif n == 2:
        print(2)
        exit()
    ans = pow(10, n, MOD) - pow(9, n, MOD) * 2 + pow(8, n, MOD)
    ans %= MOD
    print(ans)

if __name__ == '__main__':
    Main()

Solution (Python):


n = int(input())

x = 10 ** 9 + 7

if n == 1:
    print(0)
    exit()

ans = 10 ** n - 9 ** n - 9 ** n + 8 ** n

print(ans % x)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
from operator import mul
from functools import reduce

mod = 1000000007
N = I()

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

Solution (Python):
n = int(input())

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

Solution (Python):
N = int(input())
MOD = 10**9 + 7

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

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

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

Solution (Python):
MOD = 10**9+7

n = int(input())
print((pow(10, max(n, 0), MOD) - pow(9, max(n, 0), MOD) -
       pow(9, max(n, 0), MOD) + pow(8, max(n, 0), MOD)) % MOD)

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

Solution (Python):
n=int(input())
a=10**n-2*9**n+8**n
b=a%(10**9+7)
print(b)

Solution (Python):
N = int(input())
MOD = 1000000000 + 7
def power_func(a, n, p):
    bi = str(format(n,"b"))
    res = 1
    for i in range(len(bi)):
        res = (res*res) % p
        if bi[i] == "1":
            res = (res*a) % p
    return res
print(str((power_func(10, N, MOD) - 2 * power_func(9, N, MOD) + power_func(8, N, MOD)) % MOD))

Solution (Python):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N = int(input())

answer = 0
rest = 10 ** 9 + 7
if N == 1:
  answer = 0
else:
  answer = (10 ** N) - (9 ** N) - (9 ** N) + (8 ** N)
print(answer % rest)

Solution (Python):
n=int(input())
modd=1000000007
if(n<2):
    ans=0
else:
    ans=(modd+pow(10,n,modd)-pow(9,n,modd)*2+pow(8,n,modd))%modd
print(ans)

Solution (Python):
import math
from sys import stdin

N = int(input())
MOD = 1000000007

def solve(N):
    res=1
    zn=1
    zz=1
    zo=1
    for i in range(N):
        res=(res*10)%MOD
    for i in range(N):
        zn=(zn*9)%MOD
    for i in range(N):
        zz=(zz*9)%MOD
    for i in range(N):
        zo=(zo*8)%MOD
    zx = ((zz + zn)%MOD - zo) % MOD
    return (res-zx)%MOD

if(N<2):print(0)
else: print(solve(N))

Solution (Python):
n=int(input())
m=10**9+7
if n==1:
  print(0)
  exit()
ans=0
ans=10**n-2*9**n+8**n
print(ans%m)

Solution (Python):

from decimal import *

n = int(input())
d = 1000000007

if 2 < n:
    
    a = 10 ** n
    a %= d
    b = 9 ** n
    b %= d
    c = 8 ** n
    c %= d
    ans = a + c - b * 2
    ans %= d
elif n == 2:
    ans = 2
else:
    ans = 0
print(ans)

Solution (Python):
m = 1000000000+7
from scipy.special import comb

n = int(input())

if n == 1:
    print(0)
    exit()
if n == 2:
    print(2)
    exit()

ans = pow(10,n) - (2 * pow(9,n) - pow(8,n))
ans %= m

print(ans)

Solution (Python):
""" C
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

M = 1000000007

def _pow(n, m):
    ret = 1
    for _ in range(m):
        ret = (ret * n) % M
    return ret

def main(N):
    return (_pow(10, N) - 2 * _pow(9, N) + _pow(8, N)) % M

if __name__ == "__main__":
    _N = readInteger()

    print(main(_N))

Solution (Python):
N = int(input())

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

Solution (Python):
N =int(input())

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

Solution (Python):
m=10**9+7
def power(a,b):
    res=1
    while(b>0):
        if(b&1):
            res=(res*a)%m
        b//=2
        a=(a*a)%m
    return res
n=int(input())
s=(power(10,n)+power(8,n))%(10**9+7)
s=(s-(2*power(9,n)))%(10**9+7)
print((s))

Solution (Python):
N = int(input())








ans = 10**N - 2*9**N + 8**N
ans %= 10**9+7

print(ans)

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

Solution (Python):
n = int(input())

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

print(str(res))

Solution (Python):
N = int(input())

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

Solution (Python):

N = int(input())

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

Solution (Python):
n = int(input())
all = 10 ** n
o0q0 = 8 ** n
o0q1 = 9 ** n - o0q0
mod = 10 ** 9 + 7
a = (all - (o0q1 * 2) -o0q0) % mod
print(a)

Solution (Python):
n = int(input())
mod = 1000000007
anss = 10**n - 9**n - 9**n + 8**n
print(anss%mod)

Solution (Python):
n = int(input())

mod = 1000000000 + 7
ans = 10 ** n
hoge = 8 ** n
fuga = 9 ** n

ans = ans - hoge - (fuga - hoge) * 2
ans = ans % mod
print(ans)

Solution (Python):
def resolve():
    import math
    n = int(input())
    if n <= 1:
        print(0)
        return
    elif n == 2:
        print(2)
        return
    print((10**n - 2 * (9**n) + 8**n) % (10**9 + 7))

resolve()

Solution (Python):
if __name__ == '__main__':
    MODULO = 10**9 + 7
    N = int(input())
    res = 2 * pow(9, N, MODULO)
    res = (pow(10,N, MODULO) + pow(8, N, MODULO) - res) % MODULO
    
    
    print(res)

Solution (Python):
m = 1000000007
 
factorials = [1]
 
for i in range(1,1000001):
    factorials.append((factorials[-1]*i) % m)
 
n = int(input())
 
if n == 1:
    print(0)
else:
    temp = pow(10,n,m) - (2*pow(9,n,m) - pow(8,n,m))
    print(temp % m)

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

if n == 1:
    print(0)
elif n == 2:
    print(2)
else:
    facs = [1] * (n+1)
    invs = [1] * (n+1)
    nfac = 1
    for i in range(1, n+1):
        nfac = nfac * i % mod
        facs[i] = nfac
        invs[i] = pow(facs[i], mod-2, mod)

    d = 0
    comb = 1
    p = 1
    for i in range(0, n):
        
        comb = facs[n] * invs[i] * invs[n-i]%mod
        d = (d + comb*p%mod) % mod
        p *= 8
        p %= mod

    
    diff = (pow(10, n, mod) - pow(8, n, mod)) % mod
    diff = (diff - (2*d%mod)) % mod
    print(diff)

Solution (Python):
def resolve():
    n=int(input())
    d=10**9+7
    m=len(bin(n))-2
    a=[(n >> j) & 1 for j in range(m)]
    ansten=1
    anshati=1
    anskyu=1
    for i in range(m):
        ten = 10
        hati = 8
        kyu=9
        if a[i]==1:
            for j in range(i):
                ten=ten*ten
                hati=hati*hati
                kyu=kyu*kyu
                ten=ten%d
                hati=hati%d
                kyu=kyu%d
            ansten*=ten
            anshati*=hati
            anskyu*=kyu
            ansten=ansten%d
            anshati=anshati%d
            anskyu=anskyu%d
    print((ansten-2*anskyu+anshati)%d)
resolve()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')






def mcomb(n, k, mod):
    def mfac(l, r, mod):
        ans = l
        for i in reversed(range(r, l)):
            ans *= i
            ans %= mod
        return ans

    A = mfac(n,n-k+1,mod)
    B = mfac(k,1,mod)
    
    B = pow(B, mod-2, mod)
    return A * B % mod

def solve():
    N = II()
    MOD = 1000000007
    if N == 1:
        print(0)
        return
    
    
    ans = pow(10, N, MOD) - ((2 * pow(9, N, MOD)) % MOD - pow(8, N, MOD)) % MOD
    print(ans % MOD)

    
if __name__ == '__main__':
    solve()

Solution (Python):
n=int(input())

if n<2:
    print(0)
    exit()

mod = 10**9+7

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

Solution (Python):
N = int(input())

n10 = 1
n8 = 1
n9 = 1
beki = N
while beki>4:
    n10 = (n10*(10**5))%(10**9+7)
    beki -= 5  
n10 = (n10*(10**beki))%(10**9+7)
beki = N
while beki>4:
    n8 = (n8*(8**5))%(10**9+7)
    beki -= 5  
n8 = (n8*(8**beki))%(10**9+7)
beki = N
while beki>4:
    n9 = (n9*(9**5))%(10**9+7)
    beki -= 5  
n9 = (n9*(9**beki))%(10**9+7)

print((n10-2*n9+n8)%(10**9+7))

Solution (Python):
n = int(input())

MOD = 10 ** 9 + 7

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

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

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

Solution (Python):

from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, heapify
import copy
import sys
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)





def LI(): return list(map(int, sys.stdin.buffer.readline().split()))




def I(): return int(sys.stdin.buffer.readline())





def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()




def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')







def IR(n): return [I() for i in range(n)]







def LIR(n): return [LI() for i in range(n)]







def SR(n): return [S() for i in range(n)]







def LSR(n): return [LS() for i in range(n)]







def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    print((pow(10, n) - (pow(9, n) + pow(9, n) - pow(8, n))) % mod)
    
    
    
    

    








def pow(a, n):
    x = 1
    while n > 0:
        if(n & 1):
            x *= a
        a = a*a
        n >>= 1
    return x


if __name__ == "__main__":
    main()

Solution (Python):
import sys
N = int(input())

if N == 1:
    print(0)
    sys.exit(0)

if N == 2:
    print(2)
    sys.exit(0)


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

Solution (Python):
n = int(input())

a = 10**n % (10**9+7)
b = 8**n % (10**9+7)
c = 9**n % (10**9+7)

x = b + a - 2*c

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

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())

count = 10**n-2*(9**n)+8**n
count = count%1000000007

print(count)

Solution (Python):
N = int(input())

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

Solution (Python):
import math

N = int(input())

count = 0

only = 8**N
one = 2 * (9**N - only)



count = 10**N - only - one

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

Solution (Python):
def powmod(a,n,mod):
    ans = 1
    while n > 0:
        if n & 1:
            ans = ans * a % mod
        a = a ** 2 % mod 
        n >>= 1 
    return ans

N=int(input())
m=10**9+7
L=[powmod(10,N,m),powmod(9,N,m),powmod(9,N,m),powmod(8,N,m)]
A=(L[0]+L[3]-(L[1]+L[2]))%m
print(A)

Solution (Python):
N = int(input())
if N == 1:
  print(0)
  exit()
if N == 2:
  print(2)
  exit()
print((10**N - (9**N)*2 + 8**N)%(10**9+7))

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

Solution (Python):
n = int(input())
total = 1
total8 = 1
total9 = 1
MOD = 1000000007

if n == 1:
    print(0)
    exit()

if n == 2:
    print(2)
    exit()

for i in range(n):
    total *= 10
    total9 *= 9
    total8 *= 8
    total %= MOD
    total8 %= MOD
    total9 %= MOD


ans = total + total8 - (2 * total9) % MOD
if ans < 0:
    ans += MOD

print(ans)

Solution (Python):
n=int(input())

MOD = 10 ** 9 + 7

if n >= 2:
  result = 10**n%MOD - (2*9**n%MOD - 8**n%MOD)
elif n == 1:
  result = 0
else:
  result = 1
print(result%MOD)

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

Solution (Python):
INF = 10 ** 9 + 7
N = int(input())
a = 10**N
b = 9**N
c = 8**N
ans = a -(b + b - c)
ans = ans%INF
print(ans)

Solution (Python):
import sys

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

n = int(input())
if n == 1:
  print(0)
  sys.exit()

mod = 10**9+7 
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 
pow8 = [0]*(n+1)
pow8[0] = 1
pow8[1] =8

pow10=10

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
    pow8[i] = (pow8[i-1]*8) % mod  
    pow10 =(pow10*10) % mod
ans = pow10 - pow8[n]
for i in range(1,n+1):
  ans = (ans - pow8[n-i]*2*cmb(n,i,mod)) % mod
               
print(ans)

Solution (Python):
MOD = 10**9 + 7
n = int(input())
if n == 1:
    print(0)
    exit()
print((pow(10,n,MOD)-pow(8,n,MOD)-pow(9,n,MOD)+pow(8,n,MOD)-pow(9,n,MOD)+pow(8,n,MOD))%MOD)

Solution (Python):
n = int(input())
n10 = 10 ** n
n9 = 9 ** n
n8 = 8 ** n
ans = n10 - 2 * n9 + n8
ans = ans % 1000000007
print(ans)

Solution (Python):
n = int(input())
m = 10 ** 9 + 7
print((pow(10, n, m) + pow(8, n, m) - 2 * pow(9, n, m)) % m)

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

    N = int(input())

    mod = (10 ** 9) +7

    ans = 0

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

    ans %= mod

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
if(N>1):
    all = 2**N * ((5**N) + (4**N)) - 2 * (9**N)
else:
    all = 0
print(all % 1000000007)

Solution (Python):
n = int(input())

ten = [0]*20
nin = [0]*20
egt = [0]*20

for i in range(0,20):
    a = (10 ** (2**i)) % (10**9 +7)
    ten[i] = a

for i in range(0,20):
    a = (9 ** (2**i)) % (10**9 +7)
    nin[i] = a

for i in range(0,20):
    a = (8 ** (2**i)) % (10**9 +7)
    egt[i] = a

l = bin(n)
m = len(l)
tens   = 1
nines  = 1
eights = 1
for i in range(0,m-2):
    if l[i+2] == '1':
        tens = (tens*ten[m-3-i])%(10**9 + 7)

for i in range(0,m-2):
    if l[i+2] == '1':
        nines = (nines*nin[m-3-i])%(10**9 + 7)

for i in range(0,m-2):
    if l[i+2] == '1':
        eights = (eights*egt[m-3-i])%(10**9 + 7)

ans = (tens - nines*2 + eights)%(10**9 + 7)
print(ans)

Solution (Python):
n = int(input())
m = 10**9 + 7
ans = 0

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


print(ans%m)

Solution (Python):
import sys

N = int(input())
if N == 1:
    print(0)
    sys.exit()

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

Solution (Python):
def ubiq(N):
    if(N == 1):
        print("0")
    elif(N == 2):
        print("2")
    else:
        result = (10**N-(9**N)*2+8**N) % (10**9+7)
        print(result)

N = int(input())
ubiq(N)

Solution (Python):
N = int(input())

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

print(int(ans))

Solution (Python):
import math
MODINT = 1000000007
n = int(input())
print((10**n - 9**n*2 + 8**n)%MODINT)

Solution (Python):
n = int(input())

if n < 2:
    print(0)
    exit()

mod = 10**9+7

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

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    mod = 10 ** 9 + 7
    print((pow(10, n) % mod - (2 * pow(9, n)) % mod + pow(8, n) % mod) % mod)


if __name__ == '__main__':
    main()

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

Solution (Python):
n=int(input())
r=10**n-(2*9**n-8**n)

m=10**9+7

print(r%m)

Solution (Python):
N = int(input())
all = 10 ** N
not_0 = 9 ** N
not_9 = 9 ** N
not_09 = 8 ** N
ans = all - ((not_0+not_9) - not_09)

if N == 1:
  print(0)
else:
  div_num = (10**9) + 7
  print(ans % div_num)

Solution (Python):
x = int(input())
ans = 0

a = (10**x)%1000000007
b = (9**x)%1000000007
c = (8**x)%1000000007

d = ((a-b)*2)%1000000007
e = (a-c)%1000000007
ans = (d-e)%1000000007
print(ans)

Solution (Python):
"""
task statement
==============

長さ N の整数の列 A_1,A_2,\ldots,A_N であって以下の条件をすべて満たすものはいくつありますか。

0 \leq A_i \leq 9
A_i=0 なる i が存在する。
A_i=9 なる i が存在する。

ただし、答えはとても大きくなる可能性があるので、10^9+7 で割った余りを出力してください。

io_style
-------
N
"""
import sys



def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n = input_int()
    if n == 1:
        print(0)
        return
    MOD = 10**9 + 7
    ans = pow(10, n, MOD) - pow(9, n, MOD) - pow(9, n, MOD) + pow(8, n, MOD)
    print(ans % MOD)
    return


if __name__ == "__main__":
    main()

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

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

Solution (Python):
n=int(input())

if n<2:
    print(0)
    exit()

mod = 10**9+7

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

Solution (Python):
N = int(input())

MOD = 10**9+7
if N == 1:
    print(0)
    exit()

def power_func(a,n,p):
    bi = str(format(n,"b"))
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res

a = power_func(10, N, MOD)
b = power_func(8, N, MOD)
c = power_func(9, N, MOD)
print((a+b-2*c)%MOD)

Solution (Python):
N=int(input())

if N<2:
    print(0)
    exit()

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

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

combi_all = 10 ** N
not0 = 9 ** N
not9 = 9 ** N
not09 = 8 ** N
ans = combi_all - not0 - not9 + not09

if ans >= mod:
  print(int(ans % mod))
else:
  print(ans)

Solution (Python):
N = int(input())

mod = 1000000007

def modpow(a, n, mod):
    res = 1
    while (n>0):
        if (n & 1):
            res = res*a%mod
        a = a*a%mod
        n = n >> 1
    return res

temp10 = modpow(10,N,mod)
temp9 = modpow(9,N,mod)
temp8 = modpow(8,N,mod)

ans = (temp10-temp9+mod)%mod
ans = (ans-temp9+mod)%mod
ans = (ans+temp8+mod)%mod

print(ans)

Solution (Python):
n=int(input())

if n<2:
    print(0)
    exit()

mod = 10**9+7

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

Solution (Python):
n = int(input())
if n < 2:
    print('0')
elif n == 2:
    print('2')
else:

    zero = 10 ** n - 9 ** n
    nine = 10 ** n - 9 ** n
    zq = 10 ** n - 8 ** n
    ans = zero + nine - zq
    print(ans % (10 ** 9 + 7))

Solution (Python):
f = []
def precompute():
    f.append(1)
    for i in range(1,10**6+1):
        f.append((f[i-1]*i)%m)
def ncr(n,r):
    return f[n]*pow(f[n-r],m-2,m)*pow(f[r],m-2,m)
    
n,m = int(input()),int(1e9+7)
precompute()
x = pow(10,n,m)%m
y = pow(8,n,m)%m
z = 1
for i in range(1,n):
    z += ncr(n,i)*pow(8,n-i,m)
print((x-(y+z+z))%m)

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

Solution (Python):
n = int(input())
MOD = pow(10, 9) + 7

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

print(ans % MOD)

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

Solution (Python):
N = int(input())
F = 10 ** 9 + 7
ans = 0
ans = 10 ** N % F
ans -= int((2 * 9 ** N) % F)
ans += int((8 ** N) % F)
ans = int(ans % F)
print(ans)

Solution (Python):

from math import factorial

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






tens = [1]
for i in range(1, n+2):
    tens.append(tens[-1]*10 % mod)
nines = [1]
for i in range(1, n+2):
    nines.append(nines[-1]*9 % mod)
eights = [1]
for i in range(1, n+2):
    eights.append(eights[-1]*8 % mod)



ans = tens[n] - eights[n] - (nines[n]-eights[n])*2


print(ans % mod)

Solution (Python):
import math
MOD = 10**9 + 7

def mod_pow(x, mod):
    xx = [1, x]
    def _pow(y, x=x):
        nonlocal xx
        if y == 0:
            return 1
        while len(xx) <= math.log(y, 2)+1:
            v = xx[-1] * xx[-1]
            v %= mod
            xx.append(v)
        i = 1
        result = 1
        while y > 0:
            if y % 2 == 1:
                result *= xx[i]
                result %= mod
            y = y >> 1
            i += 1
        return result
    return _pow

pow10 = mod_pow(10, MOD)
pow9 = mod_pow(9, MOD)
pow8 = mod_pow(8, MOD)

def f(n):
    ans = pow10(n) - (2 * pow9(n) - pow8(n))
    ans %= MOD
    return ans


def main():
    N = int(input())
    ans = f(N)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
w = 1000000007

if(n == 1):
  print(0)
  exit()
if(n == 2):
  print(2)
  exit()
  
ans1 = 1


for i in range(n):
  ans1 = ans1*10%w
  
ans2 = 2

for i in range(n):
  ans2 = ans2*9%w
  
ans3 = 1

for i in range(n):
  ans3 = ans3*8%w

ans = ans1-ans2+ans3
ans %= w
ans += w
ans %= w

print(ans)

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