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):
import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline


I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda: list(map(int, input().split()))
MOD = int(1e9 + 7)

n = I()
if n < 2:
    print(0)
else:
    ans = (10 ** n)  
    ans %= MOD
    ans -= 2 * (9 ** n)  
    ans %= MOD
    ans += 8 ** n  
    ans %= MOD
    print(ans)

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

def power_func(a,b,p):
  if b==0: return 1
  if b%2==0:
    d=power_func(a,b//2,p)
    return d*d %p
  if b%2==1:
    return (a*power_func(a,b-1,p ))%p

y = 1000000007
print((power_func(10,N,y)-2*power_func(9,N,y)+power_func(8,N,y))%y)

Solution (Python):
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)

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

Solution (Python):
def ri():
    return int(input())


def rii():
    return [int(v) for v in input().split()]


def solve():
    N = ri()
    m = int(1e9 + 7)
    ans = 10 ** N % m
    ans = (ans - 9 ** N) % m
    ans = (ans - 9 ** N) % m
    ans = (ans + 8 ** N) % m

    print(ans)


if __name__ == "__main__":
    solve()

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

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

den = int(1e9 + 7)
print((10**n - 2 * 9**n + 8**n) % den)

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

Solution (Python):
n = int(input())
num_list = [0]*n

mod = (10**9)+7

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
n = int(readline())
if n > 1 : print((pow(10,n) - 2*pow(9,n) + pow(8,n)) % 1000000007)
else : print(0)

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






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

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

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

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

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(250000)



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

    
    
    
    
    
    
    
    
    

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

main()

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

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

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

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

Solution (Python):
MOD = 1000000007


def powmod(n, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        x = powmod(n, p // 2) % MOD
        return (x * x) % MOD
    x = powmod(n, p - 1) % MOD
    return (n * x) % MOD


def main():
    n=int(input())
    ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n)
    ans %= MOD
    ans = (ans + MOD) % MOD
    return ans


if __name__ == '__main__':
    print(main())

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

Solution (Python):
n=int(input())
mod=10**9+7
def pw(k,t):
    return pow(k,t,mod)

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

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

p=10**n
q=8**n
r=(9**n)*2

print((p-r+q)%(10**9+7))

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

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

Solution (Python):
N=int(input())
a,b,c=(1,1,1)
MOD=1000000007
for i in range(N):
    a=(a*10)%MOD
    b=(b*9)%MOD
    c=(c*8)%MOD
ans=a-(b*2-c)

print(ans%MOD)

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())

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


if __name__ == '__main__':
    main()

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

print(a%x)

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

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

Solution (Python):
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]


MOD = 10**9 + 7
YES, NO, IMP = "YES", "NO", "IMPOSSIBLE"
from collections import defaultdict as ddic

MOD = 10 ** 9 + 7
n = rri()
every = pow(10, n, MOD)
none = pow(8, n, MOD)
no_zero = no_nine = pow(9, n, MOD)

zero_and_nine = every - no_zero - no_nine + none
zero_and_nine %= MOD
print zero_and_nine

Solution (Python):
def powmod(x, y, mod):
    res = pow(x, y) % mod
    return res

N = int(input())
mod = pow(10, 9) + 7

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

Solution (Python):
import sys
from scipy.special import comb


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
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 S(): return input()
def LS(): return input().split()


INF = float('inf')
MOD = 10**9 + 7

n = I()
ans = pow(10, n) % MOD
ans = (ans - pow(9, n)) % MOD
ans = (ans - pow(9, n)) % MOD
ans = (ans + pow(8, n)) % MOD
print(ans)

Solution (Python):
def powmod(x, y, mod):
    res = pow(x, y) % mod
    return res

N = int(input())
mod = pow(10, 9) + 7

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

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

N = int(input())
print((pow(10, N, mod) - 2 * pow(9, N, mod) + 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)
ans %= mod

print(ans)

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    N = Scanner.int()
    MOD = 1000000007
    ans = pow(10, N, MOD)
    ans -= pow(9, N, MOD)

    ans -= pow(9, N, MOD)
    ans += pow(8, N, MOD)
    while ans < 0:
        ans += MOD
    ans %= MOD
    print(ans)


def main():
    
    
    solve()
    
    


if __name__ == "__main__":
    main()

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

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

print(ans % mod)

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

Solution (Python):
mod = 10**9 + 7
def solve(n):
    s = 2*pow(9, n, mod) % mod
    d = pow(8, n, mod) % mod
    ans_inv = (s - d)%mod
    ans = (pow(10, n, mod) - ans_inv) % mod

    return ans

n = int(input())
print(solve(n))

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

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

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

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

N = int(input())

s, n, z, e = 1, 0, 0, 0
for _ in range(N):
    s, n, z, e = 8 * s, s + n * 9, s + z * 9, n + z + e * 10
    s %= mod
    n %= mod
    z %= mod
    e %= mod

print(e)

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())
mod = 10**9 + 7
ans = pow(10, N, mod) - 2*pow(9, N, mod) + pow(8, N, mod)
print((ans + mod) % mod)

Solution (Python):

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

Solution (Python):
N = int(input())
MOD = 1e9+7


def powmod(x, y):
    res = 1
    for p in range(y):
        res = res*x%MOD
    return res

ans = powmod(10,N)-powmod(9,N)-powmod(9,N)+powmod(8,N)
print(int(ans%MOD))

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())
print((10**n - 9**n*2 + 8**n) % (10 ** 9 + 7))

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

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

mod = 10**9 + 7

ans = 10**n - 9**n * 2 + 8**n
ans %= mod

print(ans)

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

Solution (Python):
from sys import exit, stdin

input = stdin.readline
import copy




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

print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(250000)

from scipy.special import comb


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

    
    
    
    
    
    
    
    
    

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

main()

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

def li():
    return [int(x) for x in input().split()]

N = int(input())

total = pow(10, N, D)
A = total - pow(9, N, D)
B = total - pow(9, N, D)
C = total - pow(8, N, D)

ans = (A + B - C) % D
print(ans)

Solution (Python):
import math

N = int(input())

mod = 10 ** 9 + 7

if N >=2:
    zero_or_nine = 10**N - 8 **N
    zero = 9 ** N - 8 ** N
    nine = 9 ** N - 8 ** N
    zero_and_nine =  zero_or_nine - zero - nine
    print(zero_and_nine % mod)

else:
    print(0)

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

Solution (Python):

import os
from sys import stdin, stdout

MOD = int(1e9) + 7


def power(a, b):
    ret = 1
    base = a
    while b > 0:
        if b % 2:
            ret *= base
            ret %= MOD
        b //= 2
        base *= base
        base %= MOD
    return ret


def solve(tc):
    n = int(stdin.readline().strip())

    ans = power(10, n)
    ans -= power(9, n)
    ans += MOD
    ans %= MOD

    ans -= power(9, n)
    ans += MOD
    ans %= MOD

    ans += power(8, n)
    ans %= MOD

    print(ans)


tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

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

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

MOD = 1000000007

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

print(ans)

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(250000)

from scipy.special import comb


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

    sum = 10**n - 9**n*2 + 8**n
    
    
    
    
    
    
    
    
    

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

main()

Solution (Python):
N = int(input())
TEN = 1
NINE = 1
EIGHT = 1
a = 10
b = 9
c = 8

mod = 10 ** 9 + 7

while N:
    if N % 2:
        TEN *= a
        TEN %= mod
        NINE *= b
        NINE %= mod
        EIGHT *= c
        EIGHT %= mod
    N //= 2
    a *= a
    a %= mod
    b *= b
    b %= mod
    c *= c
    c %= mod

print((TEN - 2 * NINE + EIGHT + mod * 2)%mod)

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

Solution (Python):
n=input()
z=[[[0 for _1 in xrange(2)] for _2 in xrange(2)] for _3 in xrange(n+1)]
z[-1][1][1]=1
for i in xrange(n-1,-1,-1):
  for j in xrange(2):
    for k in xrange(2):
      for t in xrange(10):
        z[i][j][k]+=z[i+1][j or t==0][k or t==9]
      z[i][j][k]%=(pow(10,9)+7)
print z[0][0][0]

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


def main():
    n = int(input())
    a = 1
    b = 1
    c = 1
    for i in range(n):
        a *= 10
        a %= M
        b *= 9
        b %= M
        c *= 8
        c %= M
    print((a - b - b + c) % M)


if __name__ == '__main__':
    main()

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

Solution (Python):
from sys import exit, stdin

input = stdin.readline
import copy





def pow_mod(a, n, d):
    tmp = 1
    for _ in range(n):
        tmp = (tmp * a) % d
    return tmp


(N,) = list(map(int, input().split()))
mod = 10 ** 9 + 7
ans = (pow_mod(10, N, mod) + pow_mod(8, N, mod) - 2 * pow_mod(9, N, mod)) % mod

print(ans)

Solution (Python):
N=int(input())
MOD = 10**9+7
ten=1
nine=1
eight=1
for i in range(N):
    ten = ten * 10 % MOD
    nine = nine * 9 % MOD
    eight = eight * 8 % MOD

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

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

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

Solution (Python):
import sys

def test(N):
    MOD = 10**9+7
    U = (pow(10, N, MOD) - 1)%MOD
    notA = (pow(9, N, MOD) - 1)% MOD
    notB = (pow(9, N, MOD) - 1)% MOD
    A = (U - notA) % MOD
    B = (U - notB) % MOD
    AnorB = (pow(8, N, MOD) - 1)%MOD
    AorB = (U - AnorB) % MOD
    AandB = (A+B-AorB) %MOD
    
    return AandB


def solve(N):
    MOD = 10**9+7
    dp = [[0, 0, 0, 0] for i in range(N+1)]
    dp[0] = [1, 0, 0, 0]
    A = 0
    B = 1
    C = 2
    D = 3
    for i in range(1, N+1):
        dp[i][A] = (dp[i-1][A]*8) % MOD
        dp[i][B] = (dp[i-1][A]   + dp[i-1][B]*9) % MOD
        dp[i][C] = (dp[i-1][A]   + dp[i-1][C]*9) % MOD
        dp[i][D] = (dp[i-1][B]   + dp[i-1][C]    + dp[i-1][D]*10) % MOD
        
    return dp[N][D]

N = int(input())
print(test(N))

Solution (Python):
def resolve():
    from itertools import permutations
    n = int(input())
    RES = 10 ** 9 + 7
    ans = 10 ** n - 2 * 9 ** n + 8 ** n
    print(ans % RES)

resolve()

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

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

def factorial(n):
    f = 1
    for i in range(1,n+1):
        f = f*i%M
    return f

def comb(n,k):
    if n==0 or k == 0:
        return 1
    if n<k:
        return 0

    return perm(n,k)*inverse(factorial(k))%M

def mcomb(n,k):
    return comb(n+k-1,k)

def perm(n,k):
    if n==0 or k == 0:
        return 1
    if n<k:
        return 0

    p = 1
    for i in range(n-k+1,n+1):
        p = p*i%M

    return p

def inverse(a):
    return pow(a,M-2,M)

def main():
    n = int(input())
    
    if n==1:
        print(0)
    else:
        ans = pow(10,n,M)-2*pow(9,n,M)+pow(8,n,M)
        ans %= M
        print(ans)

if __name__ == "__main__":
    main()

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

ans = 10**n -2 * 9**n + 8**n
ans %= MOD

print(ans%MOD)

Solution (Python):
m = 10**9 + 7
def powmod(x,y):
  a=1
  for i in range(y):
    a=(a*x)%m
  return a
n=int(input())
s=powmod(10,n)-2*powmod(9,n)+powmod(8,n)
print((s+m)%m)

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

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

Solution (Python):
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)

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

mod = 10**9 + 7

if __name__ == "__main__":
    n = int(input())
    all0 = (10**n)
    no0 = (9**n)
    no9 = (9**n)
    no0and9 = (8**n)
    ans = (all0 - no0 - no9 + no0and9)%mod
    print(ans)

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

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

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

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

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

Solution (Python):
from sys import stdin
N = stdin.readline().rstrip()
N = int(N)
satisfied_pattern = 10**N - (2*(9**N) - 8**N)
output = satisfied_pattern % (10**9+7)
print(output)

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

mod = int(1e9+7)

have_any = 1
not_have_0 = 1
not_have_9 = 1
not_have_09 = 1

for _ in range(n):
    have_any *= 10
    have_any %= mod

    not_have_0 *= 9
    not_have_0 %= mod

    not_have_09 *= 8
    not_have_09 %= mod

not_have_9 = not_have_0

ans = have_any - not_have_0 - not_have_9 + not_have_09
ans %= mod
print(ans)

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

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

Solution (Python):
import sys

def powmod(a, n, _mod):
    res = 1
    for i in range(n):
        res = a * res % mod
    return res
N = int(input())

mod = 1000000007

ans = powmod(10, N, mod) - powmod(9, N, mod) - powmod(9, N, mod) + powmod(8, N, mod)
ans %= mod
if ans < 0:
    ans = (ans + mod) % mod
print(ans)

Solution (Python):
import sys
 
input = sys.stdin.readline

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

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

Solution (Python):
M = 1000000007
n = int(input())
if n == 1:
    print(0)
    exit(0)
a = pow(10, n, M)
b = 2 * (pow(9, n, M)) % M
c = pow(8, n, M)
ans = (a - b + c + M) % M
print(ans)

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

if n == 1:
  print(0)
elif n == 2:
  print(2)
else:
  a = pow(10,n) % mod
  b = pow(9,n) % mod
  c = pow(9,n) % mod
  d = pow(8,n) % mod
  print((a-b-c+d)%mod)

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

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

Solution (Python):
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)

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

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

Solution (Python):
n = int(input())
mod = int(1e9) + 7

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

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

if n == 1:
  print(0)
elif n == 2:
  print(2)
else:
  a = pow(10,n) % mod
  b = pow(9,n) % mod
  c = pow(9,n) % mod
  d = pow(8,n) % mod
  print((a-b-c+d)%mod)

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

Solution (Python):
n = int(input())
mod = int(1e9) + 7

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

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









def main(n):
    result = 0
    tens = 10
    eights = 9
    fives = 8
    for i in range(1, n+1):
        result = (tens - (2 * eights) + fives) % MOD
        tens = (tens * 10) % MOD
        eights = (eights * 9) % MOD
        fives = (fives * 8) % MOD
    return result


n = int(input())
print(main(n))

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

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

ans1=1
ans2=1
ans3=1

for i in range(N):
  ans1 = ans1*10 % MOD
  ans2 = ans2*9 % MOD
  ans3 = ans3*8 % MOD

print((ans1-2*ans2+ans3) % MOD)

Solution (Python):
n=int(input())
if n<2:

    print(0)
else:
 
    mod=10**9+7
    exclusion=2*pow(9,n,mod)-pow(8,n,mod)
    total=pow(10,n,mod)
    ans=total-exclusion
    print(ans%mod)

Solution (Python):
n = int(input())
mod = 1_000_000_007;
res = pow(10,n,mod) - 2*pow(9,n,mod) + pow(8,n,mod)
print(res%mod)

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

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








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

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

Solution (Python):
N, = map(int, input().split())
mod = 10**9+7
R=pow(10, N, mod) - 2*pow(9, N, mod) + pow(8, N, mod)
print(R%mod)

Solution (Python):
MOD=10**9+7
N=int(input())
 
all=pow(10,N,MOD)
sub9=pow(9,N,MOD)
sub8=pow(8,N,MOD)
print((all-2*sub9+sub8)%MOD)

Solution (Python):
n=int(input(''))
A=10**9+7
if n==1:
    print(0)
elif n==2:
    print(2)
elif n>=3:
    e=1
    f=1
    g=1
    for i in range(n):
        e=e*10
        f=f*9
        g=g*8
        if e>=A:
           e=e%A
        if f>=A:
            f=f%A
        if g>=A:
            g=g%A

    print((e-f*2+g)%A)

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

Solution (Python):
mod = 10**9+7
def powmod(x,y):
    res = 1
    for i in range(y):
        res = res*x%mod
    
    return res

N = int(input())
ans = powmod(10,N)-powmod(9,N)-powmod(9,N)+powmod(8,N)
ans %=mod
ans = (ans+mod)%mod
print(ans)

Solution (Python):
INF=1000000007;
def RepeatSquaring(N,P,M):
    if (P == 0):
      return 1;
    if (P % 2 == 0):
        t = RepeatSquaring(N, P / 2, M);
        return t * t % M;
    return N * RepeatSquaring(N, P - 1, M);
N=int(input())
A=RepeatSquaring(9,N,INF);
B=RepeatSquaring(8,N,INF);
C=RepeatSquaring(10,N,INF);
print((C+B-A*2)%INF)

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

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

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

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
dp = [[[0]*2 for _ in range(2)] for _ in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
    for x in range(10):
        if x == 0:
            for j in range(2):
                dp[i+1][1][j] += dp[i][0][j]
                dp[i+1][1][j] += dp[i][1][j]
                dp[i+1][1][j] %= mod
        elif x == 9:
            for j in range(2):
                dp[i+1][j][1] += dp[i][j][1]
                dp[i+1][j][1] += dp[i][j][0]
                dp[i+1][j][1] %= mod
        else:
            for j in range(2):
                for k in range(2):
                    dp[i+1][j][k] += dp[i][j][k]
                    dp[i+1][j][k] %= mod
print(dp[-1][1][1])

Solution (Python):



"""






















using namespace std;

using int64 = long long;




template <typename T>
class Modular {
 public:
  using Type = typename decay<decltype(T::value)>::type;

  constexpr Modular() : value() {}
  template <typename U>
  Modular(const U& x) {
    value = normalize(x);
  }

  template <typename U>
  static Type normalize(const U& x) {
    Type v;
    if (-mod() <= x && x < mod()) v = static_cast<Type>(x);
    else v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }

  const Type& operator()() const { return value; }
  template <typename U>
  explicit operator U() const { return static_cast<U>(value); }
  constexpr static Type mod() { return T::value; }

  Modular& operator+=(const Modular& other) { if ((value += other.value) >= mod()) value -= mod(); return *this; }
  Modular& operator-=(const Modular& other) { if ((value -= other.value) < 0) value += mod(); return *this; }
  template <typename U> Modular& operator+=(const U& other) { return *this += Modular(other); }
  template <typename U> Modular& operator-=(const U& other) { return *this -= Modular(other); }
  Modular& operator++() { return *this += 1; }
  Modular& operator--() { return *this -= 1; }
  Modular operator++(int) { Modular result(*this); *this += 1; return result; }
  Modular operator--(int) { Modular result(*this); *this -= 1; return result; }
  Modular operator-() const { return Modular(-value); }

  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int>::value, Modular>::type& operator*=(const Modular& rhs) {
  
    uint64_t x = static_cast<int64_t>(value) * static_cast<int64_t>(rhs.value);
    uint32_t xh = static_cast<uint32_t>(x >> 32), xl = static_cast<uint32_t>(x), d, m;
    asm(
      "divl %4; \n\t"
      : "=a" (d), "=d" (m)
      : "d" (xh), "a" (xl), "r" (mod())
    );
    value = m;
  
    value = normalize(static_cast<int64_t>(value) * static_cast<int64_t>(rhs.value));
  
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int64_t>::value, Modular>::type& operator*=(const Modular& rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) * rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Modular<U>::Type>::value, Modular>::type& operator*=(const Modular& rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }

  Modular& operator/=(const Modular& other) { return *this *= Modular(inverse(other.value, mod())); }

  template <typename U>
  friend const Modular<U>& abs(const Modular<U>& v) { return v; }

  template <typename U>
  friend bool operator==(const Modular<U>& lhs, const Modular<U>& rhs);

  template <typename U>
  friend bool operator<(const Modular<U>& lhs, const Modular<U>& rhs);

  template <typename U>
  friend std::istream& operator>>(std::istream& stream, Modular<U>& number);

 private:
  Type value;
};

template <typename T> bool operator==(const Modular<T>& lhs, const Modular<T>& rhs) { return lhs.value == rhs.value; }
template <typename T, typename U> bool operator==(const Modular<T>& lhs, U rhs) { return lhs == Modular<T>(rhs); }
template <typename T, typename U> bool operator==(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) == rhs; }

template <typename T> bool operator!=(const Modular<T>& lhs, const Modular<T>& rhs) { return !(lhs == rhs); }
template <typename T, typename U> bool operator!=(const Modular<T>& lhs, U rhs) { return !(lhs == rhs); }
template <typename T, typename U> bool operator!=(U lhs, const Modular<T>& rhs) { return !(lhs == rhs); }

template <typename T> bool operator<(const Modular<T>& lhs, const Modular<T>& rhs) { return lhs.value < rhs.value; }

template <typename T> Modular<T> operator+(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) += rhs; }
template <typename T, typename U> Modular<T> operator+(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) += rhs; }
template <typename T, typename U> Modular<T> operator+(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) += rhs; }

template <typename T> Modular<T> operator-(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) -= rhs; }
template <typename T, typename U> Modular<T> operator-(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) -= rhs; }
template <typename T, typename U> Modular<T> operator-(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) -= rhs; }

template <typename T> Modular<T> operator*(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) *= rhs; }
template <typename T, typename U> Modular<T> operator*(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) *= rhs; }
template <typename T, typename U> Modular<T> operator*(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) *= rhs; }

template <typename T> Modular<T> operator/(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) /= rhs; }
template <typename T, typename U> Modular<T> operator/(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) /= rhs; }
template <typename T, typename U> Modular<T> operator/(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) /= rhs; }

template<typename T, typename U>
Modular<T> power(const Modular<T>& a, const U& b) {
  assert(b >= 0);
  Modular<T> x = a, res = 1;
  U p = b;
  while (p > 0) {
    if (p & 1) res *= x;
    x *= x;
    p >>= 1;
  }
  return res;
}

template <typename T>
bool IsZero(const Modular<T>& number) {
  return number() == 0;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& stream, const Modular<T>& number) {
  return stream << number();
}

template <typename T>
std::istream& operator>>(std::istream& stream, Modular<T>& number) {
  typename common_type<typename Modular<T>::Type, int64_t>::type x;
  stream >> x;
  number.value = Modular<T>::normalize(x);
  return stream;
}

/*
using ModType = int;

struct VarMod { static ModType value; };
ModType VarMod::value;
ModType& MOD = VarMod::value;
using Mint = Modular<VarMod>;
*/

constexpr int MOD = (int) 1e9 + 7;
using Mint = Modular<std::integral_constant<std::decay<decltype(MOD)>::type, MOD>>;


int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n; cin >> n;
  // 10^n - 9^n - 9^n + 8^n
  Mint ans = power((Mint)10, n) - power((Mint)9, n) - power((Mint)9, n) + power((Mint)8, n);
  cout << ans << endl;

  return 0;
}

"""

import base64
import subprocess
import zlib


exe_bin = "c%1E9eQ*=U6<<mI

open("./kyomu", 'wb').write(zlib.decompress(base64.b85decode(exe_bin)))
subprocess.run(["chmod +x ./kyomu"], shell=True)
subprocess.run(["./kyomu"], shell=True)

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