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

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

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

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
print((pow(10, n, mod) - pow(9, n, mod) - pow(9, n, mod) + pow(8, n, mod)) % mod)

Solution (Python):
MOD = 10**9+7
def mod(x):
    return x % MOD

def solve(n):
    """
    0: {}
    1: {0}
    2: {9}
    3: {0,9}
    """
    x = [1,0,0,0]
    for i in range(n):
        x = list(map(mod, (
            8*x[0],
            (9*x[1] + x[0]),
            (9*x[2] + x[0]),
            (10*x[3] + x[2] + x[1])
        )))
    return x[3]

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

Solution (Python):
MOD = 10**9+7
def solve(n):
    """
    0: {}
    1: {0}
    2: {9}
    3: {0,9}
    """
    dp = [[0]*4 for i in range(n+1)]
    dp[0][0] = 1
    x = [1,0,0,0]
    for i in range(n):
        x = [
            (8*x[0]) % MOD,
            (9*x[1] + x[0]) % MOD,
            (9*x[2] + x[0]) % MOD,
            (10*x[3] + x[2] + x[1]) % MOD
        ]
    return x[3]

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

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

Solution (Python):
MOD = 10**9+7
def solve(n):
    """
    0: {}
    1: {0}
    2: {9}
    3: {0,9}
    """
    dp = [[0]*4 for i in range(n+1)]
    dp[0][0] = 1
    for i in range(n):
        dp[i+1][3] = (10*dp[i][3] + dp[i][2] + dp[i][1]) % MOD
        dp[i+1][2] = (9*dp[i][2] + dp[i][0]) % MOD
        dp[i+1][1] = (9*dp[i][1] + dp[i][0]) % MOD
        dp[i+1][0] = (8*dp[i][0]) % MOD
    return dp[n][3]

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

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

main()

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

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

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

S_all = pow(10, N, MOD)
S_0 = pow(9, N, MOD)
S_9 = S_0
S_09 = pow(8, N, MOD)

ans = (S_all - (S_0 + S_9 - S_09)) % MOD
print(ans)

Solution (Python):
N = int(input())
n =10**9 + 7
a = (10**N) % n
b = (9**N) % n
c = (8**N) % n

x = (a - 2*b + c) % n
print(x)

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

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

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

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

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

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

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

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

print(ans)

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

Solution (Python):
def main():
    num = int(input())
    con = 10**9 + 7
    a, b, c = 1, 1, 2
    for i in range(num):
        a *= 10
        a %= con
        b *= 8
        b %= con
        c *= 9
        c %= con
    if(a+b-c < 0):
        print(a+b-c+con)
        return 0
    print(a+b-c)


if __name__ == '__main__':
    main()

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

mod = 10 ** 9 + 7

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

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

all_num = 10**N


not_9 = 9**N


not_0 = 9**N



not_0_9 = 8**N
print((all_num-(not_9+not_0)+not_0_9) % (10**9+7))

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

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

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

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

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

Solution (Python):
N = int(input())
MOD = 10**9 + 7
a1, a2, a3 = 1, 1, 1

for _ in range(N):
    a1 *= 10
    a1 %= MOD

for _ in range(N):
    a2 *= 9
    a2 %= MOD
a2 *= 2
a2 %= MOD

for _ in range(N):
    a3 *= 8
    a3 %= MOD

ans = a1 - a2 + a3
ans %= MOD
print(ans)

Solution (Python):
import sys


n = int(input())

pmax = 10 ** 9 + 7

if n == 1 or n== 0 :
    print('0')
    sys.exit()
    
elif n == 2:
    print('2')
    sys.exit()


x = 10 ** n % pmax
y = 9 ** n % pmax
z = 9 ** n % pmax
yz = 8 ** n % pmax

ans = (x - y - z + yz) % pmax


print(ans)

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

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

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

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

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

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

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

Solution (Python):



N = int(input())

p = 10**9 + 7

ret = pow(10, N, p)
ret -= pow(9, N, p)
ret -= pow(9, N, p)
ret += pow(8, N, p)

ret = (ret + p) % p

print(ret)

Solution (Python):



N = int(input())

p = 10**9 + 7

ret = pow(10, N)
ret -= pow(9, N) 
ret -= pow(9, N)
ret += pow(8, N)

ret %= p

print(ret)

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

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

mod = 10 ** 9 + 7
dp = [[0, 0, 0, 0] for _ in range(N)]






dp[0][0] = 8
dp[0][1] = 1
dp[0][2] = 1
dp[0][3] = 0

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

print(dp[N-1][3])

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
x = (10**N)%mod
y = (2*(9**N))%mod
z = (8**N)%mod
print((x-y+z)%mod)

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

a10 = 10**N
a9 = 9**N
a8 = 8**N
print((a10-a9-a9+a8) % MOD)

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

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

ans %= mod

print(ans)

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

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 = 1000000007

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

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

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

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

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

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

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




all_pattern = 10 ** N


pattern_a = 8 ** N


pattern_b = 9 ** N - 8 ** N

ans = all_pattern - pattern_a - pattern_b * 2
ans = ans % (10**9 + 7)

print(ans)

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

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

Solution (Python):


def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 整数(1 <= N <= 10**6)
    """
    
    ans = 10**N - 2 * 9**N + 8**N
    ans %= 10**9 + 7

    
    print(ans)


if __name__ == "__main__":
    
    N = get_input()

    
    main(N)

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

def pow_mod(a, n, MOD):
    ret = 1
    for i in range(n):
        ret = a * ret % MOD
    return ret

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

Solution (Python):
N = int(input())
mod = 10**9+7
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())
k = 1000000007
if n == 1:
  print(0)
  
else:
  print(((10**n)%k - (2* 9**n)%k+(8**n)%k)%k)

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

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



div=10**9+7
def po(x,n,M):
    res=1
    if n>0:
        
        res= po(x,n//2,M)
    if n%2==0:
        res=(res*res)%M
    else:
        res=(((res*res)%M)*x)%M
        
      
    return res

A=po(10,N,div)
B=po(9,N,div)
C=po(8,N,div)
ans=(A-2*B+C)%div
print(ans)

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

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

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

ans = 10**9+7

allN = 10**N 
left = 9 ** N 
right = 9 ** N 
ryoutan = 8 ** N 

ncc =  allN - left - right + ryoutan
print(int(ncc%ans))

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

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

print(ans%mod)

Solution (Python):
def calc(intN):  

    ret=10**intN+8**intN-2*(9**intN)
    return ret%(10**9+7)

N = int(input())

print(calc(N))

Solution (Python):
N = int(input())
mod = 10**9+7
S = 10**N%mod
O = 8**N%mod

ans = ((S +O)%mod - 2*9**N%mod)%mod
print(ans)

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

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

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

mod = 1000000007

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

print(ans)

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

Solution (Python):


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

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

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






















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

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


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

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

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

if t==1:
  print(0)
else:
  kans = 1
  for i in range(t):
    kans *= 10
    kans = kans % mod
  
  ans = 1
  for i in range(t):
    ans *= 9
    ans = ans % mod
    
  bans = 1
  for i in range(t):
    bans *= 8
    bans = bans % mod
    
  f = kans - ans*2 + bans
  f = f%mod
  
  print(f)

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

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

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

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

print(ans)

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

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

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

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

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

print(ans)

Solution (Python):
def main():
  MOD = int(1e9 + 7)
  n = int(input())
  print((pow(10,n,MOD) - 2*pow(9 , n , MOD)%MOD + pow(8 , n , MOD) + MOD)%MOD)
 
if __name__ == "__main__":
  main()

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

Solution (Python):
import math
from functools import reduce

"""[summary]
全体：10^N
0が含まれない：9^N
9が含まれない：9^N
0,9の両方が含まれない：8^N
0,9のどちらか一方が含まれない：9^N + 9^N - 8^N
"""

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

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

print(calc)

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

Solution (Python):
mod =10**9+7
n=int(input())
if n<2:exit(print(0))
elif n==2:exit(print(2))

ans = 10**n - 9**n*2 + 8**n
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

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

Solution (Python):
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math


rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

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

def main():
	n = int(rl())
	x = pow(10, n, MOD) - 2*pow(9, n, MOD) + pow(8, n, MOD)
	print(x % MOD)
	stdout.close()

if __name__ == "__main__":
	main()

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

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

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())
p=10**9+7
a=pow(10,n,p)
b=pow(9,n,p)
c=pow(8,n,p)
r=a-2*b+c
print(r%p)

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




x = 1
y = 1
w = 1
z = 1000000007
for i in range( n ):
    x = ( x % z ) * 10
    y = ( y % z ) * 9
    w = ( w % z ) * 8


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

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

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

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

mod = 10 ** 9 + 7


eight = pow(8, n, mod)
nine = pow(9, n, mod)
ten = pow(10, n, mod)

ans = (ten - nine - nine + eight) % mod


print(ans)

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

def po(a,n):
    r = 1
    while n != 0:
        if n % 2 == 1:
            r = (r*a)%p
        a = (a*a)%p
        n = n//2
    return r

print((po(10,N)-2*po(9,N)+po(8,N))%p)

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

Solution (Python):
N = int(input())
mod = int(1e9) + 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
a = (10**N)%mod
b = (9**N)%mod
c = (8**N)%mod
ans = (a+c-2*b)%mod
print(ans)

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

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

Solution (Python):
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math


rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

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

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

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

	for i in range(n):
		for j in range(2):
			for k in range(2):
				for d in range(10):
					nj = j or d == 0
					nk = k or d == 9
					dp[i+1][nj][nk] += dp[i][j][k]
					dp[i+1][nj][nk] %= MOD 

	ans = dp[n][1][1]
	print(ans)
	stdout.close()

if __name__ == "__main__":
	main()

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

Solution (Python):
n=int(input())
p=10**9+7
total=(10**n)%p
except_0=(9**n)%p
except_9=except_0
except_both=(8**n)%p


print((total-except_0-except_9+except_both)%p)

Solution (Python):



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

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

ans = pow(10,n,MOD) - pow(9,n,MOD) - pow(9,n,MOD) + pow(8,n,MOD) 
print((ans+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):
def pow(a,b):
    ans=1
    if b==0:
        return 1
    for i in range(b):
        ans=ans*a
        if ans > mod:
            ans=ans%mod
    return ans%mod
        
        
mod=1000000007

n=int(input())

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

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

Solution (Python):



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

    print(ans%mod)

if __name__ == '__main__':
    main()

Solution (Python):
MOD = 10 ** 9 + 7
n = int(input())
ans10 = 10
ans9 = 9
ans8 = 8
for i in range(n - 1):
    ans10 = ans10 * 10 % MOD
    ans9 = ans9 * 9 % MOD
    ans8 = ans8 * 8 % MOD
ans = (ans10 - ans9 - ans9 + ans8) % MOD
ans = (ans + MOD) % MOD
print(ans)

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

def div(n,T):
    _ = 1
    for t in range(T):
        _ *= n
        _ %= tmp
    return _
    
N = int(input())
a = div(10,N)
b = div(9,N)
c = div(8,N)

print((a + c - 2 * b) % tmp)

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

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

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

N = int(input())

result = 0

ten = pow(10, N, mod)
nine = pow(9, N, mod)
eight = pow(8, N, mod)

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

print(result)

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

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

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

Solution (Python):

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

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

Solution (Python):
import math
n = int(input())
mod = 1000000007
all = pow(10, n, mod)
s1 = 2 * pow(9, n, mod) % mod
s2 = pow(8, n, mod) % mod
ans = int(all - s1 + s2)%mod
if ans < 0:
    ans += mod
print(ans%mod)

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

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

Solution (Python):




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


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    s = int(input())
    mod = 10**9+7

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


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
N = int(input())
M = 7 + 10 ** 9
A = 0


def fac_mod(a, b):
    x = 1
    for i in range(1, b+1):
        x = (x*a) % M
    return x


A = (fac_mod(10, N) - fac_mod(9, N) * 2 + fac_mod(8, N)) % M
if A < 0:
    A = M + A
print(A)

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

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

Solution (Python):
n = int(input())
a = 10**9+7
def mod(i,j):
    ans = 1
    for _ in range(j):
        ans = (ans*i)%a
    return(ans)

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

Solution (Python):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
h = 10 ** 9 + 7
n_10 = pow(10,n,h)
n_9 = pow(9,n,h)
n_8 = pow(8,n,h)
ans = (n_10 - 2*n_9 + n_8) % h
print(ans)

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

answer = (pow(10, N, MOD) + pow(8, N, MOD) - 2 * pow(9, N, MOD)) % MOD
print(answer + MOD if answer < 0 else answer)

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

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

Solution (Python):

import sys

def pow_r(x, n):
    if n == 0:
        return 1
    if n % 2 == 0:
        return pow_r(x ** 2, n //2)
    else:
        return x * pow_r(x ** 2, (n - 1) // 2)

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

    
    
    
    
    
    
    

    
    
    
    
    

    
    S = pow(10, n)

    M = pow(9, n)
    M2 = pow(8, n)

    out = (S - (M + M - M2)) % (1000000000 + 7)

    
    print("{}".format(out))

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

n=int(input())

















sum=10**n-(9**n+9**n-8**n)



print(sum%MOD)

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

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

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

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

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

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

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

import sys

def pow_r(x, n):
    if n == 0:
        return 1
    if n % 2 == 0:
        return pow_r(x ** 2, n //2)
    else:
        return x * pow_r(x ** 2, (n - 1) // 2)

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

    
    
    
    
    
    
    

    
    
    
    
    

    
    S = pow_r(10, n)

    M = pow_r(9, n)
    M2 = pow_r(8, n)

    out = (S - (M + M - M2)) % (1000000000 + 7)

    
    print("{}".format(out))

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

Solution (Python):
def func(x, n):
  res = 1
  for _ in range(n):
    res = res * x % MOD
  return res

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

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

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

n=int(input())
ans= 10**n - 9**n - 9**n + 8**n
print(ans%MOD)

Solution (Python):
from sys import stdin, stdout

MOD = int(1e9+7)

if __name__ == '__main__':
    N = int(stdin.readline().rstrip())
    stdout.write(str((pow(10, N, MOD)-(2*pow(9, N, MOD))+pow(8, N, MOD))%MOD))

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

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

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

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

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

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

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

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

Solution (Python):


mod=10**9+7

N=int(input())

a,b,c=1,1,1

for _ in range(N):
    a*=10
    a%=mod
    b*=9
    b%=mod
    c*=8
    c%=mod

print((a-2*b+c)%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):
n=int(input())
print((10**n-9**n-9**n+8**n) % (10**9+7))

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

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

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

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

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

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

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

n10 = 1
for _ in range(n):
    n10 = n10 * 10 % mod
n9 = 1
for _ in range(n):
    n9 = n9 * 9 % mod
n8 = 1
for _ in range(n):
    n8 = n8 * 8 % mod

ans = n10 - 2 * n9 + n8
print(ans % mod)

Solution (Python):
def resolve():
    md = 10**9+7
    N = int(input())
    dpt = [[0,0,0,0] for _ in range(N)]
    dpt[0][0]=8
    dpt[0][1]=1    
    dpt[0][2]=1
    dpt[0][3]=0

    for i in range(1,N):
        dpt[i][0] =(dpt[i-1][0]*8)%md 
        dpt[i][1] =(dpt[i-1][1]*9+dpt[i-1][0])%md
        dpt[i][2] =(dpt[i-1][2]*9+dpt[i-1][0])%md
        dpt[i][3] =(dpt[i-1][3]*10+dpt[i-1][1]+dpt[i-1][2])%md
    print(dpt[-1][-1])
resolve()

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

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


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

print(ans)

Solution (Python):
N = int(input())
MOD = 10 ** 9 + 7
res = pow(10, N, MOD) - 2 * pow(9, N, MOD) + pow(8, N, MOD)
if res < 0:
    while res < 0:
        res += MOD
elif res > MOD:
    while res > MOD:
        res -= MOD
print(res)

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

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

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

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

print(A)

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

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

Solution (Python):
from sys import stdin


def modpow(a, n, mod):
    """ 二分累乗法 """
    n_bin = bin(n)
    res = 1
    for i in range(len(n_bin)):
        res = res**2 % mod
        if n_bin[i] == '1':
            res = (res * a) % mod
    return res


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  
    
    MOD = 10**9 + 7
    ans =  pow(10, N, MOD)      
    ans -=  pow(9, N, MOD) * 2  
    ans +=  pow(8, N, MOD)      
    ans %= MOD
    
    print(ans)


if __name__ == "__main__":
    main()

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

while ans < 0:
    ans += mod
print(ans)

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

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

Solution (Python):

mod = 1000000007
N = int(input())

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

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

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


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

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

Solution (Python):
n = int(input())
powof10 = 1
powof9 = 1
powof8 = 1
MOD = 10**9+7
for _ in range(n):
    powof10 *= 10
    powof10 %= MOD
    powof9 *= 9
    powof9 %= MOD
    powof8 *= 8
    powof8 %= MOD
print((powof10-2*powof9+powof8) % MOD)

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

n9 = 1
n8 = 1
n10 = 1

for i in range(N):
    n9 = (n9*9)%MOD
    n8 = (n8*8)%MOD
    n10 = (n10*10)%MOD

ans = n10 - 2*n9 + n8
print(ans%MOD)