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):
MOD = 10 ** 9 + 7

n = int(input())

x = pow(10, n, MOD)
y = pow(9, n, MOD)
z = pow(8, n, MOD)

ans = (((x - ((2 * y) % MOD) + MOD) % MOD) + z) % MOD

print(ans)

Solution (Python):


import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def cmb_mod(N, mod=10**9+7):
    N1 = N + 1
    g1 = [0] * N1
    g2 = [0] * N1
    inv = [0] * N1
    g1[0] = g1[1] = g2[0] = g2[1] = inv[1] = 1

    for i in range(2, N1):
        g1[i] = g1[i-1] * i % mod
        inv[i] = -inv[mod % i ] * (mod//i) % mod
        
        g2[i] = g2[i-1] * inv[i] % mod

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

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

    cmb = cmb_mod(N)

    ans = 0
    x8 = 1
    ans = pow(10, N, mod)
    for i in reversed(range(1, N+1)):
        tmp = 2 * cmb(N, i) * x8 % mod
        ans = (ans - tmp) % mod
        x8 = x8*8 % mod

    ans = (ans - x8) % mod

    print(ans)

if __name__ == "__main__":
    resolve()

Solution (Python):
from math import factorial

def calc_permutation(n, r):
    return factorial(n) // factorial(n - r)


if __name__ == '__main__':
    n = int(input())

    mod_num = 10 ** 9 + 7

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

Solution (Python):
n = int(input())
a = [8]; b = [1]; c = [1]; d = [0]; m = 10**9+7
for _ in range(n-1):
    d.append((b[-1]+c[-1]+d[-1]*10)%m)
    c.append((a[-1]+c[-1]*9)%m)
    b.append((a[-1]+b[-1]*9)%m)
    a.append(a[-1]*8%m)
print(d[-1])

Solution (Python):

import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7
N = int(readline())
if N == 1:
    print(0)
    sys.exit()
    
a = pow(10,N,MOD)
b = pow(9,N,MOD)
c = pow(8,N,MOD)

ans = ((a-b)*2%MOD - (a-c)%MOD) % MOD

print(ans)

Solution (Python):
def resolve():
    N = int(input())
    MOD = 10**9+7
    if N < 2:
        print(0)
    elif N == 2:
        print(2)
    else:
        noone = 9**N
        noone %= MOD
        notwo = 8**N
        notwo %= MOD
        ALL = 10**N
        ALL %= MOD
        zeroplsnine = ALL - noone
        zeroplsnine %= MOD
        zeroplsnine *= 2
        zeroplsnine %= MOD
        zeroandnine = ALL - notwo
        zeroandnine %= MOD
        ans = zeroplsnine - zeroandnine
        ans %= MOD
        print(ans)
    


if '__main__' == __name__:
    resolve()

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

Solution (Python):
num = int(input())
mod = 10 ** 9 + 7
ans = 0
if num >= 2:
    temp9 = (9 ** num) % mod
    temp8 = (8 ** num) % mod
    val = (temp9 * 2 - temp8) % mod
    ans = (10 ** num) % mod + mod - val
print(ans % mod)

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

def f(n, m):
    ans = 1
    for _ in range(m):
        ans *= n
        ans %= MOD
    return ans

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

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

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

n = int(input())
bp1 = [0 for i in range(n + 1)]
bp0 = [0 for i in range(n + 1)]

bp1[1] = 2
bp0[1] = 8

for i in range(2, n + 1):
  bp0[i] = (bp0[i - 1] * 8) % PRIME
  bp1[i] = (bp1[i - 1] * 9 + bp0[i - 1] * 2) % PRIME

ans = pow(10, n, PRIME) + (PRIME - bp0[n]) + (PRIME - bp1[n])
print(ans % PRIME)

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

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

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

Solution (Python):
n=int(input())
mod=10**9+7
if n==1:
    print(0)
    exit()
if n==2:
    print(2)
    exit()
nine,ei,se=1,1,1
for i in range(n):
    nine*=10
    nine%=mod
    ei*=9
    ei%=mod
    se*=8
    se%=mod
print((nine-2*ei+se)%mod)

Solution (Python):



def solve(*args: str) -> str:
    n = int(args[0])
    mod = 10**9+7

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


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):
n = int(input())
M = 10 ** n
m1 = 8 ** n
m2 = (9 ** n) - (8 ** n) 

print((M - m1 - 2*m2)%((10 ** 9) + 7))

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

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

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

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

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


if(N == 2):
  print("2")
  exit()
if(N == 1):
  print("0")
  exit()
ans_n = 10**N - 2*9**N + 8**N 
answer = ans_n % 1000000007

print(answer)

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

Solution (Python):

import sys

input = sys.stdin.readline
mod = 1000000007


def ST():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


n = I()

ten = 1
nine = 1
eight = 1
for _ in range(n):
    ten *= 10
    ten %= mod
    nine *= 9
    nine %= mod
    eight *= 8
    eight %= mod

ans = ten - 2 * nine + eight
ans %= mod
print(ans)

Solution (Python):

x = 1000000007

n = int(input())

ans10 = 1
ans9 = 1
ans8 = 1
for i in range(n):
    ans10 *= 10
    ans10 %= x

    ans9 *= 9
    ans9 %= x

    ans8 *= 8
    ans8 %= x

ans=(ans10 - 2*ans9 + ans8) % x

print(ans)

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

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

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

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

print(x)

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

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

print(mod)

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

def pow(x, n):
    ans = 1
    n_tmp = n
    while n:
        if n % 2:
            ans *= x
            ans %= mod
        x *= x
        n >>= 1
    return ans

mod = 10**9+7 

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

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

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

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

A = 1
B = 1
C = 1

for i in range(N):
    A *= 10
    A = A % int(1e+9 + 7)

for i in range(N):
    B *= 9
    B = B % int(1e+9 + 7)

for i in range(N):
    C *= 8
    C = C % int(1e+9 + 7)

D = A - 2 * B + C
D = D % int(1e+9 + 7)

print(D)

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

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

ans_num = 10**N - 2*9**N + 8**N 
ans = ans_num % 1000000007

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)
ans %= mod

print(ans)

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

Solution (Python):
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N = NI()

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


    print(ans % MOD)

if __name__ == '__main__':
    main()

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

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

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

MOD=10**9+7
if N==1:
    ans=0
elif N==2:
    ans=2
else:
    ans10=1
    ans9=1
    ans8=1

    for i in range(N):
        ans10=ans10*10%MOD
        ans9=ans9*9%MOD
        ans8=ans8*8%MOD

    ans=(ans10-2*ans9+ans8)%MOD

print(ans)

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

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

print(result%mod)

Solution (Python):

import sys

MOD = 1000000007  

def solve(N: int):
    a = pow(10, N, MOD)
    b = pow(9, N, MOD)
    c = pow(8, N, MOD)
    return (2 * (a - b) - (a - c)) % MOD


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    print(solve(N))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
import itertools


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


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

Solution (Python):
mod = 1000000007

N = int(input())

total = 10**N
non_9 = 9**N
non_09 = 8**N

ans = (total-2*non_9+non_09)%mod

print(ans)

Solution (Python):
n=int(input())
if n>2:
  N=10**n
  i=9**n
  j=8**n
  k=N-2*i+j
  print(k%(10**9+7))

elif n ==2:
  print(2)

else:
  print(0)

Solution (Python):
N = int(input().strip())
if N == 1:
    print(0)
    exit(0)

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

print(res)

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

Solution (Python):




import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    
    
    n=int(readline())
    mod=10**9+7
    p10=pow(10,n,mod)+mod*5
    p8=pow(8,n,mod)
    p9=pow(9,n,mod)
    ans=p10+p8-p9-p9
    ans=ans%mod


    print(ans)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

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

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

mod = int(10**9+7)

zeronai = 1
for i in range(N):
    zeronai = zeronai * 9
    zeronai = zeronai % mod

dottimonai = 1
for i in range(N):
    dottimonai = dottimonai * 8
    dottimonai = dottimonai % mod

aru = 1
for i in range(N):
    aru = aru * 10
    aru %= mod



print((aru - 2*zeronai + dottimonai) % mod)

Solution (Python):

from scipy.special import comb
n = int(input())
if n == 1:
  print(0)
else:
  mod = 1000000007
  ans = (10 ** n - 9 ** n - 9 ** n + 8 ** n) % mod
  print(ans)

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

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

def combination(n,r,mod=10**9+7):
    r=min(r,n-r)
    up,down=1,1
    for i in range(r):
        up=up*(n-i)%mod
        down=down*(i+1)%mod
    return up*pow(down,mod-2,mod)%mod

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

now = 1
hiki = 1
hiki2 = 1

for i in range(n):
    now *= 10
    hiki *= 8
    hiki2 *= 9

    now %= mod
    hiki %= mod
    hiki2 %= mod

hiki2 *= 2
hiki2 %= mod

print((now+hiki-hiki2)%mod)

Solution (Python):
import math

mod = 1000000007

def add(a, b):
    return (a + b) % mod
def sub(a, b):
    return (a + mod - b) % mod
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y/2)**2 % mod
    else            : return power(x, y/2)**2 * x % mod

def div(a, b):
    return mul(a, power(b, mod-2))


N = int(input())





c = 1
d = 1
e = 1
for i in range(N):
    c = mul(c,10)
for i in range(N):
    e = mul(e,9)
for i in range(N):
    d = mul(d,8)

print(sub(sub(c,mul(sub(e,d),2)),d))

Solution (Python):
from sys import stdin
INF = 10**9 + 7
n = int(stdin.readline().rstrip())
ten = 1
nine = 1
eight = 1
for x in range(n):
    ten = (ten * 10) % INF
    nine = (nine * 9) % INF
    eight = (eight * 8) % INF
ans = (((ten + eight) % INF) - ((2 * nine) % INF)) % INF
if ans < 0:
    ans += INF
print(ans)

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

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


if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):

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

if N <= 1:
    print(0)
    exit()

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

Solution (Python):
N = int(input())
mod = 10**9+7
ans = 0
if N == 1:
    print(ans)
    exit()
else:
    ans = 2

memo_1 = 9*9
memo_2 = 8*8
for i in range(2,N):
    ans *= 10
    ans %= mod
    ans += (memo_1*2)%mod - (memo_2*2)%mod
    ans %= mod
    memo_1 *= 9
    memo_1 %= mod
    memo_2 *= 8
    memo_2 %= mod
print(ans)

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

Solution (Python):
from scipy.special import comb



N=int(input())

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

Solution (Python):
from math import factorial

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    if n == 1:
        print(0)
        exit()

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


if __name__ == '__main__':
    resolve()

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

Solution (Python):
N = int(input())
M = 10 ** 9 + 7
set1 = (9 ** N) % M
set2 = (10 ** N) % M
set3 = (8 ** N) % M
tmp = (set2 + set3)% M
tmp = (tmp - set1)% M
print((tmp - set1)% M)

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

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
if n==1:
  print(0)
else:
  print((2*(pow(10,n,mod)-pow(9,n,mod))-(pow(10,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

def powmod(x, n, mod):

    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K = (K*x)%mod
        x = (x*x) % mod
        n = n // 2

    return (K * x) % mod

sol = powmod(10,n,mod) - 2 * powmod(9,n,mod) + powmod(8,n,mod)
sol = sol % mod
print(sol)

Solution (Python):
import sys
import itertools as it


N = int(sys.stdin.readline().strip())

M = 10 ** 9 + 7


def pow(x, n):
    if n == 0:
        return 1
    ret = pow(x, n // 2)
    if n % 2 == 0:
        return (ret * ret) % M
    else:
        return (ret * ret * x) % M


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

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

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

print(y)

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


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

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

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

Solution (Python):
a = int(input())
temp = int(1)
mod = int(1000000007)
temp2 = int(1)
temp3 = int(1)
ans = int(0)
if a >= 2:
    for i in range(a):
        temp = temp * 10
        temp = temp % mod
        temp2 = temp2 * 8
        temp2 = temp2 % mod
        temp3 = temp3 * 9
        temp3 = temp3 % mod
    ans = temp + temp2 - temp3*2
    ans = ans % mod
    print(ans)
else:
    print(0)

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

ans = 0
tmp = 10
for i in range(1, n):
    tmp *= 10
    tmp %= 1000000007
ans += tmp
tmp = 18
for i in range(1, n):
    tmp *= 9
    tmp %= 1000000007
ans -= tmp
tmp = 8
for i in range(1, n):
    tmp *= 8
    tmp %= 1000000007
ans += tmp
if ans < 0:
    ans += 1000000007
print(ans)

Solution (Python):
def mod(x):
    return int(x % (1e+9 + 7))


def power(x, n):
    ans = 1
    for _ in range(n):
        ans = mod(ans) * mod(x)
    return mod(ans)


def combination(n):
    return mod(power(10, n) - 2 * power(9, n) + power(8, n))


if __name__ == '__main__':
    N = int(input())
    print(combination(N))

Solution (Python):




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








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

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


def main():
    N = int(input())
    if N == 1:
        print(0)
        return
    ans = pow(10, N, MOD) - (pow(9, N, MOD) + pow(9, N, MOD) - pow(8, N, MOD))
    ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

print(ans)

Solution (Python):
import sys
import math

mod = 10 ** 9 + 7

N = int(input())

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


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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
INF = 10**18
sys.setrecursionlimit(10**6)
import itertools as it
import collections as cl
from collections import deque
import math
from functools import reduce
from collections import defaultdict
D = 10 ** 9 + 7

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


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())

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

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

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

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

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

Solution (Python):
N = int(input())
m = 1000000007
if N == 1:
    print(0)
else:
    print((pow(10,N,m)-pow(9,N,m)-pow(9,N,m)+pow(8,N,m))%m)

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


def add(a, b, BIGMOD):
    return (a + b) % BIGMOD


def sub(a, b, BIGMOD):
    return (a - b + BIGMOD) % BIGMOD


MOD = 10 ** 9 + 7

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

print(sub(D,sub(add(A,B,MOD),C,MOD),MOD))

Solution (Python):

import os,sys
from io import BytesIO, IOBase

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

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")

if __name__ == '__main__':
    main()

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

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

def factorial(p, n):
    result = 1
    for i in range(1, n + 1):
        result = result * p % mod
    return result

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

while True:
    if ans > 0:
        break
    ans += mod

print(ans)

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

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

if n == 1:
    print(0)
    exit()
    
ans = pow(10,n,mod)
ans -= pow(9,n,mod)*2
ans += pow(8,n,mod)
ans %= mod
print(ans)

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

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

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

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

Solution (Python):
N=int(input())
x=10**N
y=9**N
z=8**N
p=x-2*y+z
MOD=10**9+7

print(p%MOD)

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

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

Solution (Python):
from sys import stdin

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

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

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

Solution (Python):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
J=int(1e9)+7


def power(a,n):
    res=1
    while(n):
        if n&1:
            res=res*a
        a=a*a
        n//=2
        res%=J
        a%=J
    return res%J
n=int(input())
x=power(10,n)-2*power(9,n)+power(8,n)
print(x%J)

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

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

Solution (Python):
import itertools

n = int(input())

matrix = 10**n

matrix_0 = 9**n

matrix_0_9 = 8**n

ans = matrix-(matrix_0*2-matrix_0_9)

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

Solution (Python):
import math

N = int(input())
if N == 1:
    print(0)
else:
    M = 10 ** 9 + 7
    res = pow(10, N, M) - ((2 * pow(9, N, M) - pow(8, N, M))) % M
    print(res % M)

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

mod = 10**9+7

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

n = ii()

b = modpow(10,n)
s = modpow(8,n)
m = modpow(9,n)

ans = b - s - 2*(m-s)

print(ans%mod)

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

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

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

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    n = ii()
    res = 2 * pow(9, n, mod) - pow(8, n, mod)    
    print((pow(10, n, mod) - res) % mod)


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):

def ge():
    return map(int,input().split())
def main():
    
    
    
    N=int(input())
    if N==1:
        print(0)
    
        
    else:
        
        
        ans=10**N-(9**N)*2+8**N
        print(ans%(10**9+7))
    


main()

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

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

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

Solution (Python):

def main():
    MOD = int(10**9+7)
    N = int(input())
    total = 1
    not0 = 1
    not9 = 1
    not09 = 1
    for _ in range(N):
        total *= 10
        total %= MOD
        not0 *= 9
        not0 %= MOD
        not9 *= 9
        not9 %= MOD
        not09 *= 8
        not09 %= MOD
    
    ans = total - not0 - not9 + not09
    while ans < 0:
        ans += MOD
    print(ans)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
mod = 10**9 + 7
def main():
  n = int(input())
  ans_every = 1
  ans_0 = 1
  ans_0_9 =  1
  for i in range(n):
    ans_every *= 10
    ans_every %= mod
    
    ans_0 *= 9
    ans_0 %= mod
    
    ans_0_9 *= 8
    ans_0_9 %= mod
  print((ans_every-(ans_0*2 -ans_0_9))%mod)
  
if __name__ == "__main__":
  main()

Solution (Python):
import math
import re






war=10**9+7

a=int(input())
if a<2:
    print(0)
    exit()

print((10**a-9**a-9**a+8**a)%war)

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

if N==1:
    ans = 0
else:
    ans = pow(10,N,mod)+pow(8,N,mod)-pow(9,N,mod)-pow(9,N,mod)

print(ans%mod)

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

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

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

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

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

if N==1:
    print(0)
elif N==2:
    print(2)
else:
    a=(10**(N))
    b1=(9**(N))
    b2 = (8 ** (N))
    c=(a-2*b1+b2)%(10**9+7)
    print(int(c))

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

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

Solution (Python):
n=int(input())
a=1
b=1
c=1
d=1000000007
if n==1:
  print(0)
elif n==2:
  print(2)
else:
  for i in range(n):
    a=(a*10)%d
    b=(b*9)%d
    c=(c*8)%d
  ans=(a+c-2*b)%d
  print(ans)

Solution (Python):
n = int(input())
ans1=1 
ans2=1
ans3=1

mod = 1000000007

for i in range(n):
    ans1 = (ans1*10)%mod
    
for i in range(n):
    ans2 = (ans2*9)%mod

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

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

Solution (Python):
def main():
    
    N = int(input())
    mod = 10**9 + 7
    ans = pow(10,N,mod) - 2*pow(9,N,mod) + pow(8,N,mod)
    print(ans%mod)
if __name__ == "__main__":
    main()

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

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

c10 = 10
c9 = 2*9
c8 = 8

BIG_M = 10**9+7

for i in range(N-1):
    c10 = (c10*10)%BIG_M
    c9 = (c9*9)%BIG_M
    c8 = (c8*8)%BIG_M
    
print((c10 - c9 + c8)%BIG_M)

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

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

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

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

Solution (Python):
n = int(input())
ten = 1
eight = 1
nine = 1
for i in range(n):
    ten *= 10
    ten = ten%(10**9 + 7)
    eight *= 8
    eight = eight%(10**9 + 7)
    nine *= 9
    nine = nine%(10**9 + 7)
print((ten+eight-(2*nine))%(10**9 + 7))

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