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 os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi


def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

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


def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y


for _ in range(int(input()) if not True else 1):
    n = int(input())
    
    
    
    
    
    if n == 1:
        print(0)
        continue

    a = [1, 27, 487]
    while len(a) <= n:
        a += [(27*a[-1]-242*a[-2]+720*a[-3])%(10**9+7)]
    print((a[-3]*2)%(10**9+7))

Solution (Python):
def main():

    n = int(input())

    if n ==1:
        print(0)
        return
    if n ==2:
        print(2)
        return
    m = (10 ** 9) + 7
    ans = (10 ** n) % m
    ans -= (8**n) %m
    ans -= ((9**n-8**n)*2)%m
    print(ans%m)
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)

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

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

all = 10 ** n
exit_2 = 9 ** n
exit_9 = 9 ** n
exit_2_9 = 8 ** n

ans = (all - (exit_2 + exit_9 - exit_2_9)) % (10**9 + 7)

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):
N = int(input())

M = 10**9+7

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

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
MOD = 10 ** 9 + 7
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

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

if __name__ == '__main__':
    resolve()

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

Solution (Python):



M = 10 ** 9 + 7


def compute(n):
    return (pow(10, n, M) - 2 * pow(9, n, M) + pow(8, n, M)) % M


def main():
    n = int(input())
    res = compute(n)
    print(res)


if __name__ == '__main__':
    main()

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

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

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


if __name__ == "__main__":
    main()

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):
n = int(input())
mod = (10 ** 9 + 7)
s = 10 ** n % mod
t = 9 ** n % mod
u = 8 ** n % mod
print((s - t * 2 + u) % mod)

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

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

INF = float("inf")


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

Solution (Python):
def pow(a, b, mod):
    result = 1
    while b:
        if b&1: result = (result * a) %mod
        a = (a * a) % mod
        b >>= 1
    return result

n = int(input())
if n <= 1:
    print(0)

else:

    mod = 10 ** 9 + 7

    print((mod + 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):
mod = 10 ** 9 + 7
n = int(input())
all = pow(10, n, mod)
each = pow(9, n, mod)
non = pow(8, n, mod)
print((all - 2 * each + non) % mod)

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

n = int(input())
ans = pow(10,n,MOD) - pow(9,n,MOD)*2 + pow(8,n,MOD)
ans %= MOD
if ans < 0:
    ans += MOD
print(ans)

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

Solution (Python):
def main():
    import sys
    N=int(sys.stdin.readline())
    if N==1:
        print(0)
        return
    m=10**9+7
    res=pow(10,N,m)-(2*pow(9,N,m)-pow(8,N,m))%m
    if res<0:
        print(res+m)
    else:
        print(res%m)

main()

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

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

Solution (Python):






def mod_pow(a, n, m=10 ** 9 + 7):
    res = 1
    while n > 0:
        if n & 1 == 1:
            res = res * a % m
        a = a * a % m
        n >>= 1
    return res


N = int(input())

ALL = mod_pow(10, N)
side = mod_pow(9, N)
none = mod_pow(8, N)

MOD = 10 ** 9 + 7

print((ALL - side * 2 + none) % MOD)

Solution (Python):
import sys
from collections import deque
from functools import lru_cache
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    N = int(input())
    if N == 1:
        print(0)
        return

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


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
a=1
b=1
c=1
mod=10**9+7
for i in range(n):
    a=a*8%mod
    b=b*9%mod
    c=c*10%mod
print((a-2*b+c+2*mod)%mod)

Solution (Python):

import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1  
MOD = 10 ** 9 + 7


def debug(*x):
    print(*x, file=sys.stderr)


def solve(N):
    nn, pn, np, pp = [8, 1, 1, 0]
    for i in range(N - 1):
        pp = (pp * 10 + np + pn) % MOD
        pn = (pn * 9 + nn) % MOD
        np = (np * 9 + nn) % MOD
        nn = (nn * 8) % MOD

    return pp


def main():
    
    N = int(input())
    print(solve(N))



T1 = """
2
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
2
"""

T2 = """
1
"""
TEST_T2 = """
>>> as_input(T2)
>>> main()
0
"""

T3 = """
869121
"""
TEST_T3 = """
>>> as_input(T3)
>>> main()
2511445
"""

T4 = """
3
"""
TEST_T4 = """
>>> as_input(T4)
>>> main()
54
"""


def _test():
    import doctest
    doctest.testmod()
    g = globals()
    for k in sorted(g):
        if k.startswith("TEST_"):
            doctest.run_docstring_examples(g[k], g, name=k)


def as_input(s):
    "use in test, use given string as input file"
    import io
    f = io.StringIO(s.strip())
    g = globals()
    g["input"] = lambda: bytes(f.readline(), "ascii")
    g["read"] = lambda: bytes(f.read(), "ascii")


input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

if sys.argv[-1] == "-t":
    print("testing")
    _test()
    sys.exit()

main()

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

N = int(input())

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

print(ans)

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

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

allp = pow(10,n,MOD)
not09 = 2*pow(9,n,MOD)
closs = pow(8,n,MOD)

print((allp - not09 + closs)%MOD)

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

N = int(input().rstrip('\n'))
res = 10**N-(9**N)*2 + 8**N
print(res % 1000000007)

Solution (Python):
def LI():return list(map(int,input().split()))
def II():return int(input())
def yes():return print("Yes")
def no():return print("No")
INF=float("inf")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
from itertools import product, combinations
from functools import reduce, lru_cache
from math import pi, gcd
from decimal import Decimal

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

class Unionfind:
    def __init__(self, N):
        self.p = list(range(N))
        self.rank = [0] * N
        self.size = [1] * N

    def root(self, x):
        if self.p[x] != x:
            self.p[x] = self.root(self.p[x])

        return self.p[x]

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        u = self.root(x)
        v = self.root(y)

        if u == v: return

        if self.rank[u] < self.rank[v]:
            self.p[u] = v
            self.size[v] += self.size[u]
            self.size[u] = 0
        else:
            self.p[v] = u
            self.size[u] += self.size[v]
            self.size[v] = 0

            if self.rank[u] == self.rank[v]:
                self.rank[u] += 1

    def count(self, x):
        return self.size[self.root(x)]

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

Solution (Python):
P = 10**9 + 7
N = int(input())
a, b, c = 1, 1, 1
for _ in range(N):
    a = (10 * a) % P
    b = (9 * b) % P
    c = (8 * c) % P
ans = (a - 2 * b + c) % P
print(ans)

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

i = ((9**N - 8**N) * 2)%MOD
j = (10**N - 8**N)%MOD

print((j-i)%MOD)

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

m = 10 ** 9 + 7

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

Solution (Python):
import math
import pprint
import fractions
import collections
import itertools
from decimal import *
from collections import deque
from bisect import *
N=int(input())
p=10**9+7
print((pow(10,N,p)+pow(8,N,p)-pow(9,N,p)-pow(9,N,p))%p)

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

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

print(ans%1000000007)

Solution (Python):


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




ten = 1
nine = 1
eight = 1

if(N == 1):
    print(0)
else:
    for i in range(N):
        ten *= 10 
        ten %= mod
        nine *= 9
        nine %= mod
        eight *= 8
        eight %= mod
        ret = ten + eight - 2* nine
    print(ret % mod)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
import random
import string
from copy import deepcopy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7






N = getN()
print((pow(10, N, mod) - pow(9, N, mod) - pow(9, N, mod) + pow(8, N, mod)) % mod)

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

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

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

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

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

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 = 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):
import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
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()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

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

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

Solution (Python):
n = int(input())
mod = 10**9+7
if (n==1):
    print(0)
elif (n==2):
    print(2)
else:
    ans = 1
    no1 = 1
    no2 = 1
    for i in range(n):
        ans *= 10
        ans %= mod
        no1 *= 9
        no1 %= mod
        no2 *= 8
        no2 %= mod
    print((ans-2*no1+no2)%mod)

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

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

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

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

Solution (Python):
(N,) = [int(x) for x in input().split()]

MOD = 10 ** 9 + 7

if N <= 1:
    print(0)
    exit()
else:
    total = pow(10, N, MOD)
    noZeroes = pow(9, N, MOD)
    noNines = pow(9, N, MOD)
    noZeroOrNines = pow(8, N, MOD)
    print((total - noZeroes - noNines + noZeroOrNines) % MOD)

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

ten=1
nine=1
eight=1

mod=10**9+7

for i in range(N):
    ten *=10
    ten %=mod
    nine *=9
    nine %=mod
    eight *=8
    eight %=mod
print((ten-2*nine+eight)%mod)

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

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

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

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

Solution (Python):

MOD = 10 ** 9 + 7
INFI = 10**10

import math
from collections import deque
import itertools
import heapq

from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint




def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default




def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def soinsubunkai_e(n,m): 
    a = set()
    i = 1
    while n>1:
        a.add(m[n])
        n=n//m[n]
    nokori=n
    a.add(nokori)
    return a

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def era(n): 
    b=[i for i in range(n+1)]
    for i in range(2,int(math.sqrt(n)+10)):
        j=1
        temp=i*j
        while temp<=n:
            b[temp]=min(i,b[temp])
            temp+=i
    return b


def main():
    
    n=int(input())
    ans=0
    not0=1
    all=1
    not01=1
    for i in range(n):
        not0*=9
        all*=10
        not01*=8
        not0%=MOD
        all%=MOD
        not01%=MOD
    if n>=2:
        ans=all-2*not0+not01
        ans%=MOD
    
    print(ans)






if __name__ == "__main__":

    main()

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

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

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

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

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

Solution (Python):
mod = 1000000007


def fexp(x, y):
    ans = 1
    while y > 0:
        if y % 2 == 1:
            ans = ans * x % mod
        x = x * x % mod
        y //= 2
    return ans


n = int(input())
ans = fexp(10, n) - 2 * fexp(9, n) + fexp(8, n)
ans %= mod
if ans < 0:
    ans += mod
print(ans)

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

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

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

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

Solution (Python):


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  
from itertools import combinations as comb  
from itertools import permutations as permutate
from bisect import bisect_left as bl



from bisect import bisect_right as br
from bisect import bisect







BUFSIZE = 8192
from sys import stderr


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)





from types import GeneratorType


def iterative(f, stack=[]):
    def wrapped_func(*args, **kwargs):
        if stack: return f(*args, **kwargs)
        to = f(*args, **kwargs)
        while True:
            if type(to) is GeneratorType:
                stack.append(to)
                to = next(to)
                continue
            stack.pop()
            if not stack: break
            to = stack[-1].send(to)
        return to

    return wrapped_func







mod = 1000000007


def inp(): return sys.stdin.readline().rstrip("\r\n")  


def out(var): sys.stdout.write(str(var))  


def lis(): return list(map(int, inp().split()))


def stringlis(): return list(map(str, inp().split()))


def sep(): return map(int, inp().split())


def strsep(): return map(str, inp().split())


def zerolist(n): return [0] * n


def nextline(): out("\n")  


def testcase(t):
    for p in range(t):
        solve()


def printlist(a):
    for p in range(0, len(a)):
        out(str(a[p]) + ' ')


def pow(x, y, p):
    res = 1  
    x = x % p  
    if (x == 0):
        return 0
    while (y > 0):
        if ((y & 1) == 1):  
            res = (res * x) % p

        y = y >> 1  
        x = (x * x) % p
    return res


from functools import reduce


def factors(n):
    return set(reduce(list.__add__,
                      ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))


def gcd(a, b):
    if a == b: return a
    while b > 0: a, b = b, a % b
    return a




def solve():
    N=10**9 +7
    n=int(inp())
    if n==1:
        print(0)
    else:
        print(((pow(10,n,N)-2*pow(9,n,N)+pow(8,n,N))%N + N)%N)


solve()

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

N = int(input())

total = (pow(10, N, M) - pow(9, N, M) * 2 + pow(8, N, M)) % M

print(total)

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

w = pow(10,N,MOD)
n = w - pow(9,N,MOD)
e = w - pow(8,N,MOD)
a = n*2 - e
print(a%MOD)

Solution (Python):
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range;R=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def NLI(n):return [[int(i) for i in input().split()] for i in range(n)]
def NLI_(n):return [[int(i)-1 for i in input().split()] for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def RLI(n=8,a=1,b=10):return [random.randint(a,b)for i in range(n)]
def RI(a=1,b=10):return random.randint(a,b)
def INP():
    N=10;A=10
    n=random.randint(1,N)
    a=[random.randint(1,A) for i in range(n)]
    return n,a
def Rtest(T):
    case,err=0,0
    for i in range(T):
        inp=INP()
        a1=naive(*inp)
        a2=solve(*inp)
        if a1!=a2:
            print((a1,a2),inp)
            err+=1
        case+=1
    print('Tested',case,'case with',err,'errors')
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'
    
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7

inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase

read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()


class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

show_flg=False
show_flg=True

ans=0

n=I()

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



print(ans%mo)

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

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

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        ret = power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        ret = n * power(n, r-1, mod) % mod
    return ret


M = 10 **9 + 7
n = int(input())
out = power(10, n, M)  - 2*  power(9, n, M) + power(8, n, M)
out = out %M

print(out)

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

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

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

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

from math import factorial as fac

mod = 10**9+7 

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