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):
n = int(input())
mod = 10 ** 9 + 7

s = 10 ** n
s0 = 9 ** n
s9 = 9 ** n
sb = 8 ** n

ans = s - s0 - s9 + sb
print(ans % mod)

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

if n == 1:
    print(0)

else:
    ans = 10 ** n - 9 ** n - 9 ** n + 8 ** n
    print(ans % d)

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

Sall = pow(10, N, MOD)
S0 = S9 = pow(9, N, MOD)
S09 = pow(8, N, MOD)

ans = (Sall - (S0 + S9 - S09)) % MOD
print(ans)

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

Solution (Python):
def main(N):
    if N==1:
        return 0
    elif N==2:
        return 2
    else:
        return (10**N - (9**N*2 - 8**N))%(10**9 + 7)

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

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

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

in_9=10**N-9**N
in_0=10**N-9**N
nine_and_zero=10**N-8**N

ans=int(int(in_0+in_9-nine_and_zero)%MOD)

print(ans)

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

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

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

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

mod = 10**9 + 7

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

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

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

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

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

print(ans%MOD)

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

N = int(input())

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

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

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n = readint()

mod = 10**9+7


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

Solution (Python):

    
    


import sys, os.path, math


    
    



mod =  1000000007
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



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

Solution (Python):

    
    


import sys, os.path, math


    
    

sys.setrecursionlimit(10 ** 5)

mod =  10**9+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



def solve():
    a=ii();print((pow(10,a,mod)+pow(8,a,mod)-2*pow(9,a,mod))%mod)
for _ in range(1):
    solve()

Solution (Python):

    
    


import sys, os.path, math


    
    

sys.setrecursionlimit(10 ** 5)

mod =  1000000007
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



def solve():
    a=ii();print((pow(10,a,mod)+pow(8,a,mod)-2*pow(9,a,mod))%mod)
for _ in range(1):
    solve()

Solution (Python):

    
    


import sys, os.path, math


    
    

sys.setrecursionlimit(10 ** 5)

mod =  1000000000+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



def solve():
    a=ii();print((pow(10,a,mod)+pow(8,a,mod)-2*pow(9,a,mod))%mod)
for _ in range(1):
    solve()

Solution (Python):

    
    


import sys, os.path, math


    
    

sys.setrecursionlimit(10 ** 5)

def mod(): return 10**9+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



def solve():
    a=ii();print((pow(10,a,mod())+pow(8,a,mod())-2*pow(9,a,mod()))%mod())
for _ in range(1):
    solve()

Solution (Python):
import math
from decimal import *
import random
from datetime import datetime
import time

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

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

Solution (Python):

    
    


import sys, os.path, math


    
    

sys.setrecursionlimit(10 ** 5)

def mod(): return 10**9+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



def solve():
    a=ii()
    print(((10**a)-2*(9**a)+(8**a))%mod())
for _ in range(1):
    solve()

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

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

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

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

N = int(input())


Na = pow(10, N, MOD)


N0 = pow(9, N, MOD)


N09 = pow(8, N, MOD)

M = Na - 2*N0 + N09

print(M%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
dp = [[[0 for _ in range(2)] for _ in range(2)] for _ in range(n)]
dp[0][0][0] = 8
dp[0][0][1] = 1
dp[0][1][0] = 1
dp[0][1][1] = 0

for i in range(n-1):
    for j in range(2):
        dp[i+1][0][0] = (dp[i][0][0] * 8) % mod
        dp[i+1][0][1] = (dp[i][0][0] + dp[i][0][1] * 9) % mod
        dp[i+1][1][0] = (dp[i][0][0] + dp[i][1][0] * 9) % mod
        dp[i+1][1][1] = (dp[i][0][1] + dp[i][1][0] + dp[i][1][1] * 10) % mod

print((dp[-1][-1][-1]) % 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())
print((pow(10, n, MOD) - 2*pow(9, n, MOD) + pow(8,n,MOD))%MOD)

Solution (Python):
"""AtCoder Beginner Contest 178.

C
"""

import sys


def input() -> str:  
    """Input."""
    return sys.stdin.readline()[:-1]


def main():
    """Run."""
    mod = 1000000007
    n = int(input())

    ans = 0

    if n <= 1:
        ans = 0
    elif n == 2:
        ans = 2
    else:
        ans = 10**n
        ans -= 9**n
        ans -= 9**n
        ans += 8**n

    print(ans % mod)


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):
MOD = int(1e9+7)


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


if __name__ == "__main__":
    main()

Solution (Python):
MOD=1000000007
ans=0
N=int(input())
def modpow(a,x):
    ret=1
    while x>0:
        if x%2==1:
            ret*=a
            ret%=MOD
        a*=a
        x>>=1
    return ret

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

Solution (Python):


n = int(input())



























dp = [[0 for j in range(4)] for i in range(n + 1)]

mod = 10 ** 9 + 7
for i in range(1, n + 1):
    for j in range(4):
        if j == 0:
            dp[i][j] = (dp[i - 1][0] * 10 + dp[i - 1][1] + dp[i - 1][2]) % mod
            if i == 1:
                dp[i][j] = 0
        elif j == 1:
            dp[i][j] = (dp[i - 1][1] * 9 + dp[i - 1][3]) % mod
            if i == 1:
                dp[i][j] = 1
        elif j == 2:
            dp[i][j] = (dp[i - 1][2] * 9 + dp[i - 1][3]) % mod
            if i == 1:
                dp[i][j] = 1
        elif j == 3:
            dp[i][j] = (dp[i - 1][3] * 8) % mod
            if i == 1:
                dp[i][j] = 8

print(dp[n][0])

Solution (Python):


n = int(input())



























dp = [[0 for j in range(4)] for i in range(n + 1)]

mod = 10 ** 9 + 7
for i in range(1, n + 1):
    for j in range(4):
        if j == 0:
            dp[i][j] = (dp[i - 1][0] * 10 + dp[i - 1][1] + dp[i - 1][2]) % mod
            if i == 1:
                dp[i][j] = 0
        elif j == 1:
            dp[i][j] = (dp[i - 1][1] * 9 + dp[i - 1][3]) % mod
            if i == 1:
                dp[i][j] = 1
        elif j == 2:
            dp[i][j] = (dp[i - 1][2] * 9 + dp[i - 1][3]) % mod
            if i == 1:
                dp[i][j] = 1
        elif j == 3:
            dp[i][j] = (dp[i - 1][3] * 8) % mod
            if i == 1:
                dp[i][j] = 8

print(dp[n][0])

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


N0 = 9 ** N % MOD
N9 = 9 ** N % MOD
NA = 10 ** N % MOD
NB = 8 ** N % MOD

ans = ( NA - (N0 + N9 - NB) ) % MOD
print(ans)

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

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

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

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

print(ans%mod)

Solution (Python):
n=int(input())
mod=10**9+7
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):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement


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

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

Solution (Python):
import sys



from copy import *
from bisect import *	



 
def eprint(*args):
    print(*args, file=sys.stderr)
zz=1
 

if zz:
	input=sys.stdin.readline
else:	
	sys.stdin=open('input.txt', 'r')
	sys.stdout=open('all.txt','w')
di=[[-1,0],[1,0],[0,1],[0,-1]]
def inc(d,c,x=1):
	d[c]=d[c]+x if c in d else x
def bo(i):
	return ord(i)-ord('A')	
def li():
	return [int(xx) for xx in input().split()]
def fli():
	return [float(x) for x in input().split()]	
def comp(a,b):
	if(a>b):
		return 2
	return 2 if a==b else 0		
def gi():	
	return [xx for xx in input().split()]
def fi():
	return int(input())
def pro(a): 
	return reduce(lambda a,b:a*b,a)		
def swap(a,i,j): 
	a[i],a[j]=a[j],a[i]	
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())			
def gh():
	sys.stdout.flush()
def isvalid(i,j):
	return 0<=i<n and 0<=j<m and a[i][j]!="."
def bo(i):
	return ord(i)-ord('a')	
def graph(n,m):
	for i in range(m):
		x,y=mi()
		a[x].append(y)
		a[y].append(x)
mod=10**9+7
t=1
while t>0:
	t-=1
	n=fi()
	dp=[[1]*4 for i in range(n+2)]
	dp[-1]=[1,0,0,0]
	for i in range(n+1):
		dp[i][0]=dp[i-1][0]*8
		dp[i][1]=dp[i-1][0]+dp[i-1][1]*9
		dp[i][2]=dp[i-1][0]+dp[i-1][2]*9
		dp[i][3]=dp[i-1][3]*10+dp[i-1][1]+dp[i-1][2]
		for j in range(4):
			dp[i][j]%=mod
			
	print(dp[n-1][3])

Solution (Python):
mod = 1000000007

n = int(input())

a = 1
b = 1
c = 1
for i in range(n):
    a = a * 10 % mod
    b = b * 8 % mod
    c = c * 9 % mod


d = (a - 2 * c + b + mod) % mod
d = (d + mod) % mod
print(d)

Solution (Python):
N = int(input())
M = 1000000007
t, t1, t2 = 1, 1, 1

for _ in range(N):
    t, t1, t2 = t*10, t1*9, t2*8
    t, t1, t2 = t%M, t1%M, t2%M

print((t - t1*2 + t2) % M)

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

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

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

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

print(ans%mod)

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

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

Solution (Python):
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

n = r()
tens=1
nines=1
eights=1
mod = 10**9+7
for i in range(n):
    tens=(tens*10)%mod
    nines=(nines*9)%mod
    eights=(eights*8)%mod
print((tens-2*nines+eights)%mod)

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

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

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

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

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())

all = (10 **N) % mod
no_zero = (9**N) % mod
no_nine = (9**N) 
no_zero_nine = 8 ** N

A = 1
no_zero = 1
no_nine = 1
no_zero_nine = 1

for i in range(N):
    A = A * 10 % mod
    no_zero = no_zero * 9 % mod
    no_zero_nine = no_zero_nine * 8 % mod

ans = (A - (no_zero * 2 - no_zero_nine)) % mod
    

print(ans)

Solution (Python):
n = int(input())
import math
ans = 0
if n == 1:
    ans =0
if n == 2:
    ans = 2
if n >= 3:
    ans = (10**n%(10**9+7)-9**n%(10**9+7)-9**n%(10**9+7)+8**n%(10**9+7))%(10**9+7)
print(ans)

Solution (Python):
from functools import reduce

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


def powmod(val, n, mod):
    
    

    

    ret = 1
    for i in range(n):
        ret = ret * val % mod

    return ret


all = powmod(10, N, mod)
b = powmod(9, N, mod)
c = powmod(8, N, mod)

ans = (all - (2*b - c))%mod

print(ans)

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

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


def powmod(val, n, mod):
    ret = 1
    for i in range(n):
        ret = ret * val % mod

    return ret


all = powmod(10, N, mod)
b = powmod(9, N, mod)
c = powmod(8, N, mod)

ans = (all - (2*b - c))%mod

print(ans)

Solution (Python):
def main():
    N = int(input())
    mod = 10 ** 9 + 7
    mod_1 = 1
    mod_2 = 1
    mod_3 = 1
    for _ in range(N):
        mod_1 = (mod_1 * 10) % mod
        mod_2 = (mod_2 * 9) % mod
        mod_3 = (mod_3 * 8) % mod
    v = (mod_1 - 2 * mod_2 + mod_3) % mod
    print(v)

if __name__ == '__main__':
    main()

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

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

def cal(N):
    return abs(10**N - 9**N - 9**N +  8**N) % (10**9+7)

print(cal(N))

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

Solution (Python):
N = int(input())
mod = 1000000007
def powmod(x,y):
  res = 1
  for i in range(y):
    res = res*x%mod
  return res
ans = powmod(10,N)-powmod(9,N)-powmod(9,N)+powmod(8,N)
ans = ans%mod
ans = (ans + mod)%mod
print(ans)

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

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

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

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

print(ans)

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

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

Solution (Python):
import sys

from collections import deque, Counter, defaultdict

import bisect
import heapq

import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))

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

Solution (Python):

import sys
sys.setrecursionlimit(1000000)

N = int(input())

MAX_N=10**6
MOD=10**9+7

fac=[None for i in range(MAX_N)]
finv=[None for i in range(MAX_N)]
inv=[None for i in range(MAX_N)]

def COMinit(num):
    global fac
    global finv
    global inv
    fac[0]=1
    fac[1]=1
    finv[0]=1
    finv[1]=1
    inv[1]=1

    for i in range(2,num):
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD

def COM(n,k):
    if n<k:
        return 0
    elif n<0 or k<0:
        return 0
    else:
        return int(fac[n] * (finv[k] * finv[n - k] % MOD) % MOD)



def modPow(a,n,p):

    if n==0:
        return 1
        
    if n == 1:
        
        
        return a % p

    elif n % 2 == 1:
        
        return a * modPow(a,n-1,p) % p

    else:
        
        t = modPow(a,n//2,p)
        return t * t % p

COMinit(MAX_N)

if N>2:
    ans = (modPow(10,N,MOD) - 2*modPow(9,N,MOD) + modPow(8,N,MOD))%MOD
elif N == 1:
    ans = 0
elif N == 2:
    ans = 2

print(ans)

Solution (Python):
n = int(input())
if n == 1:
  print(0)
  exit()

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

Solution (Python):








N = int(input())









































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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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

Solution (Python):
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):
mod = 1000000007
n = int(input())
ans = pow(10,n,mod) - 2 * pow(9,n,mod) + pow(8,n,mod)
ans = (ans % mod + mod) % mod
print(ans)

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

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

mod = 10 ** 9 + 7

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

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

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

val2 = pow(8,N,MOD)
ans = pow(10,N,MOD) - 2*val1 + val2
print(ans%MOD)

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

all_ptn = 10 ** n
anti_ptn = 2 * (9 ** n) - 8 ** n

print((all_ptn - anti_ptn) % p)

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

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

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

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

print(ans%mod)

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

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

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

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

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

Solution (Python):



N = int(input())


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

Solution (Python):
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

N = int(input())

def solve():
    mod = 10**9+7
    ans = 10**N - (9**N)*2 + 8**N
    ans %= mod
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

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


def main():
    mod = 10**9 + 7
    n = int(input())
    all = pow(10, n, mod)
    non_0 = non_9 = pow(9, n, mod)
    non_0_and_9 = pow(8, n, mod)
    ans = all - non_0 - non_9 + non_0_and_9
    print(ans % mod)


if __name__ == "__main__":
    main()

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

sousuu = 10 ** N
not9 = 9 ** N
not0 = 9 ** N
not09 = 8 ** N
print((sousuu - not9 - not0 + not09) % (10 ** 9 + 7))

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

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

Solution (Python):

N = int(input())

kMod = 10**9+7

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

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

Solution (Python):
import math

mod = 10**9+7
N = int(input())
'''
def modpow(x,y):
    res = 1
    for _ in range(y):
        res = res * x % mod
    return res
'''
def modpow(a,n):
    res = 1
    while n > 0:
        if n & 1:
            res = res *a % mod
        a = a * a % mod
        n >>= 1
    return res

def main():
    ans = 0
    x0 = modpow(8,N)
    x1 = modpow(9,N)
    x2 = modpow(10,N)
    ans = (x2-2*x1+x0)%mod    

    print(ans)
main()

Solution (Python):
MOD = 1e9 + 7
n = int(input())
ans = [[0, 1, 1, 8]]
for i in range(n-1):
    a, b, c, d = ans.pop()
    a = (a * 10 + b + c) % MOD
    b = (b * 9 + d) % MOD
    c = (c * 9 + d) % MOD
    d = (d * 8) % MOD
    ans.append([a, b, c, d])

a, b, c, d = ans.pop()
print(int(a))

Solution (Python):
NUM = 1000000007

N = int(input())

all_colab = pow(10, N)
except_0or9_colab = pow(9, N)
except_0and9_colab = pow(8, N)

include_0and9_colab = all_colab - (2*except_0or9_colab - except_0and9_colab)

print(include_0and9_colab % NUM)

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

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

print(ans)

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

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

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

Q = 10 ** 9 + 7

a10 = 1
a9 = 1
a8 = 1

for _ in range(N):
    a10 *= 10 
    a9 *= 9 
    a8 *= 8
      
    a10 %= Q
    a9 %= Q
    a8 %= Q

ans = (a10 - (2 * a9 - a8)) % Q

print(ans)

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

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

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

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

Solution (Python):

n = int(input())

m = 10**9+7

a = 10 ** n

b = 9 ** n

c = 9 ** n

d = 8 ** n

ans = (a-(b+c-d)) % m

print(ans)

Solution (Python):
N = int(input())
MOD = 10 ** 9 + 7
D = [0] * 4
D[0] = 1

for i in range(N):
	ND = list(D)
	ND[0] = (D[0] * 8) % MOD
	ND[1] = (D[0] + D[1] * 9) % MOD
	ND[2] = (D[0] + D[2] * 9) % MOD
	ND[3] = (D[3] * 10 + D[1] + D[2]) % MOD
	D = ND

print(D[-1])

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

Solution (Python):
import math

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

print(result)

Solution (Python):
N = int(input())
mod = 10**9 + 7
dp = [[0]*4 for _ in range(N+1)]
dp[1][0] = 8
dp[1][1] = 1
dp[1][2] = 1

for i in range(2, N+1):
    dp[i][0] = dp[i-1][0]*8 % mod
    dp[i][1] = (dp[i-1][0] + dp[i-1][1]*9) % mod
    dp[i][2] = (dp[i-1][0] + dp[i-1][2]*9) % mod
    dp[i][3] = (dp[i-1][1] + dp[i-1][2] + dp[i-1][3]*10) % mod

print(dp[N][3]%mod)

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

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

ans = 0
MOD = 10**9+7

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

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

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

Solution (Python):
n = int(input())
mod = 10**9 + 7
contain_zero = 0
contain_nine = 0
not_contain_zero_and_nine = 0
all_per = pow(10,n,mod)
if n < 2:
    print(0)
else:
    contain_zero = all_per - pow(9,n,mod)
    contain_nine = all_per - pow(9,n,mod)
    not_contain_zero_and_nine = pow(8,n,mod)
    print((-(all_per - not_contain_zero_and_nine -contain_nine - contain_zero))%mod)

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







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

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

Solution (Python):
N = int(input())
mod = 10**9 + 7
def inv(x):
    return pow(x, mod - 2, mod)
def comb(n, k):
    ue = 1
    shita = 1
    n %= mod
    for i in range(k):
        ue = ue * (n - i) % mod
        shita = shita * (i + 1) % mod
    return ue * inv(shita) % mod
if N == 1:
    print(0)
else:
    print((pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod))%mod)

Solution (Python):
n = int(input())
nPowTen = pow(10,n,pow(10,9) + 7)
nPowNine = pow(9,n,pow(10,9) + 7)
nPowEight = pow(8,n,pow(10,9) + 7)

print((nPowTen - nPowNine - nPowNine +nPowEight) % (pow(10,9) + 7))

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

if __name__ == "__main__":
    main()

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

MOD_VALUE = math.pow(10, 9) + 7

def pow_mod(value, pow):
    ret = 1
    for _ in range(pow):
        ret = ret * value % MOD_VALUE
    return ret

result = pow_mod(10, N) - pow_mod(9, N) * 2 + pow_mod(8, N)

print(int(result % MOD_VALUE))

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

if __name__ == '__main__':
    main()

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

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

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

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

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

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


def _mod(x, y):
    res = 1
    for i in range(y):
        res = (res * x) % mod
    return res


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

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


def _mod(x, y):
    res = 1
    for i in range(y):
        res = (res * x) % mod
    return res


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

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

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

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

main()

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

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

MOD = 1000000007

def mod(n):         
  return n % MOD

def modpow(a, n):   
    res = 1  
    digit = len(str(bin(n))) - 2
    for i in range(digit):
      if (n >> i) & 1:
        res *= mod(a)
        res = mod(res)
      a = mod(a**2)
    return mod(res)
  
ans = modpow(10, n)
ans -= 2*modpow(9, n)
ans += modpow(8, n)
print(mod(ans))

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

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

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

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

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





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


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

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

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