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

Solution (Python):
import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque 

input = sys.stdin.readline

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def _dbg(o):
    print(o, file=sys.stderr)



N = inp()
mod = 10**9 + 7
_dbg(mod)

a = 1
b = 1
c = 1
for _ in range(N):
    a = (a * 10) % mod
    b = (b * 9) % mod
    c = (c * 8) % mod
print((a - 2 * b + c) % mod)

Solution (Python):
def solve():
    N = int(input())
    MOD = 10**9+7
    U = pow(10,N,MOD)
    inc_zero = U - pow(9,N,MOD)
    inc_nine = inc_zero

    inc_both = U - pow(8,N,MOD)

    print((inc_zero+inc_nine-inc_both) % MOD)

if __name__ == '__main__':
    solve()

Solution (Python):
mod = 1000000007

N = int(input())

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

b = 2
for i in range(N):
    b = (b * 9) % mod

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

print((a - b + c) % mod)

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

Solution (Python):
mod = 1000000007

n = int(input())

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

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

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

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

if N==1:
    print(0)
elif N ==2:
    print(2)
else:
    ans2 = 0
    ans1 = 2
    ans0 = 8
    
    for i in range(N-1):
        ans2 = ans2*10 + ans1*1
        ans1 = ans1*9 + ans0*2
        ans0 = ans0*8
        ans2 %= mod
        ans1 %= mod
        ans0 %= mod
        
    print(ans2)

Solution (Python):
"""
                            pppppppppppppppppppp
                         ppppp  ppppppppppppppppppp
                      ppppppp    ppppppppppppppppppppp
                      pppppppp  pppppppppppppppppppppp
                      pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
       ppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppp
      pppppppppppppppppppppppppppppppppppppppppppppppp  ppppppppppppppppppppp
     ppppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppppp
    ppppppppppppppppppppppppppppppppppppppppppppppp    pppppppppppppppppppppppp
   pppppppppppppppppppppppppppppppppppppppppppppp     pppppppppppppppppppppppppp
  ppppppppppppppppppppppppppppppppppppppppppppp      pppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppppppp               pppppppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppp     pppppppppppppppppppppppppppppppppppppppppppppp
  ppppppppppppppppppppppppppp    pppppppppppppppppppppppppppppppppppppppppppppppp
    pppppppppppppppppppppppp  pppppppppppppppppppppppppppppppppppppppppppppppppp
     ppppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppppp
      pppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppp
       ppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
                              pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppp  pppppppp
                              ppppppppppppppppppppp    ppppppp
                                 ppppppppppppppppppp  ppppp
                                    pppppppppppppppppppp
"""


import sys
from functools import lru_cache, cmp_to_key
from collections import defaultdict as dd, deque, Counter as C
from bisect import bisect_left as bl, bisect_right as br, bisect
from heapq import heapify, heappop, heappush
from math import ceil, log, floor, sqrt
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var, end="\n"): sys.stdout.write(str(var)+end)
def outa(*var, end="\n"): sys.stdout.write(' '.join(map(str, var)) + end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


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

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

Solution (Python):
n=int(input())
a = 1
b = 1
c = 1
m = 10**9 + 7

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

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

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

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

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools











N = int(input())
mod = 10**9+7
ans = 0
ten = 1
nine = 1
eight = 1

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

neight = 2*nine - eight

if(neight<0):
  neight += mod

ans = ten - neight

if(ans<0):
  ans += mod

print(ans%mod)

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

k=10**9+7
def njou(x,n):

    ans=1
    for i in range(n):
        ans=ans*x
        if ans>k:
            ans=ans%k
    return(int(ans))
print((njou(10,N)+njou(8,N)-2*njou(9,N))%k)

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

m = (10**9)+7

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

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

Solution (Python):
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
if n==1:
	print(0)
	exit()
mod = 10**9+7
a = pow(10,n,mod)
b = pow(8,n,mod)
c = pow(9,n,mod)
print((a-2*c+b)%mod)

Solution (Python):

import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


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

    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

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

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

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


MOD = 10 ** 9 + 7


def main():
    N = II()

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

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

    print(ans)


main()

Solution (Python):
def readinput():
    n=int(input())
    return n

def main(n):
    MOD=10**9+7
    ans=pow(10,n,MOD)-pow(9,n,MOD)-pow(9,n,MOD)+pow(8,n,MOD)
    ans=(ans+MOD)%MOD
    return ans

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

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

Solution (Python):
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()


    
def solve():
    n = inp()
    print((pow(10,n,1000000007) - pow(9,n,1000000007) - pow(9,n,1000000007) + pow(8,n,1000000007)) % 1000000007)
    


 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 

def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)

def counter_elements(a):
    q = dict()
    for i in range(len(a)):
        if a[i] not in q:
            q[a[i]] = 0
        q[a[i]] = q[a[i]] + 1
    return(q)

def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)
 
def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))
 
def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

def transpose(a):
    n,m = len(a),len(a[0])
    b = [[0] * n for i in range(m)]
    for i in range(m): 
        for j in range(n): 
            b[i][j] = a[j][i]
    return(b)


        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

Solution (Python):




import sys
input = sys.stdin.readline



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

    mod = 10 ** 9 + 7

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

    print(res)



main()

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

def f(a,n):
	mod = (10 ** 9 )+ 7
	
	if n == 0:
		return 1
	t = f(a,n/2) % mod
	return ((t ** 2) * (a if n%2 else 1)) %mod

print (f(10,n) - f(9,n) - f(9,n) + f(8,n)) %mod

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

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

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

Solution (Python):
n = int(input())
if n == 1:
  print(0)
  quit()
mod = 10**9+7
s = 1
n0 = 1
n09 = 1
for i in range(n):
  s*=10
  n0*=9
  n09*=8
  s%=mod
  n0%=mod
  n09%=mod

n0*=2
n0%=mod

ans=s-n0
ans%=mod

ans+=n09
ans%=mod

print(ans)

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

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

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

Solution (Python):
N = int(input())
all_pattern = 10**N

not_using_nine_and_zero_pattern = 8**N
using_zero_pattern = all_pattern - 9**N
using_nine_pattern = all_pattern - 9**N

ans = -(all_pattern - not_using_nine_and_zero_pattern -
        using_nine_pattern - using_zero_pattern)

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

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

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


def _i(): return int(sys.stdin.readline().strip())


class Bigint:
    def __init__(self, n, mod=10**9+7):
        self.n = n % mod
        self.mod = mod
        return

    def __str__(self):
        return str(self.n)

    def __add__(self, other):
        ot = type(other)
        if ot == Bigint:
            return Bigint(self.n+other.n, self.mod)
        elif ot == int:
            return Bigint(self.n+other, self.mod)
        else:
            raise ValueError("Invalid type")

    def __iadd__(self, other):
        return self.__add__(other)

    def __sub__(self, other):
        ot = type(other)
        if ot == Bigint:
            o = other.n
        elif ot == int:
            o = other
        else:
            raise ValueError("Invalid type")
        
        return Bigint(self.n - o, self.mod)

    def __isub__(self, other):
        return self.__sub__(other)

    def __mul__(self, other):
        ot = type(other)
        if ot == Bigint:
            return Bigint(self.n*other.n, self.mod)
        elif ot == int:
            return Bigint(self.n*other, self.mod)
        else:
            raise ValueError("Invalid type")

    def __imul__(self, other):
        return self.__mul__(other)

    def __pow__(self, other):
        assert type(other) == int, "power should be integer"
        
        if other < 0:
            return self ** (other % (self.mod-1))
        ret = Bigint(1, self.mod)
        now = Bigint(self.n, self.mod)
        while other > 0:
            if other % 2 == 0:
                pass
            else:
                ret *= now
            other //= 2
            now *= now
        return ret

    def __truediv__(self, other):
        ot = type(other)
        if ot == Bigint:
            o = other
        elif ot == int:
            o = Bigint(other)
        else:
            raise ValueError("Invalid type")

        self *= (o ** (o.mod-2))
        return self

    def __itruediv__(self, other):
        return self.__truediv__(other)


def main():
    n = _i()
    a = Bigint(10) ** n
    b = Bigint(8) ** n
    c = Bigint(9) ** n - b
    return a - b - Bigint(2) * c


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

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

mod = 10**9 + 7

total = pow(10, N, mod)
not_0 = pow(9, N, mod)
not_9 = not_0
not_9_and_0 = pow(8, N, mod)

ans = ( total - (not_0 + not_9 - not_9_and_0) ) % mod

print(ans)

Solution (Python):









import os
import sys




def main():
    N = int(input())
    no_0 = 9**N
    no_9 = 9**N
    no_09 = 8**N
    total = 10**N
    print((total-no_0-no_9+no_09)%1000000007)


if __name__ == "__main__":
    main()

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

Solution (Python):
MOD =  pow(10,9)+7
def MODINV(n:int, MOD=MOD):
    return pow(n, MOD-2, MOD)

def main():
    N = int(input())
    if N < 2:
        print(0)
        return
    not0 = pow(9, N, MOD)
    not9 = pow(9, N, MOD)
    not0and9 = pow(8, N, MOD)
    ans = pow(10, N, MOD) - not0 - not0 + not0and9
    ans %= MOD
    print(ans)

if __name__ == "__main__":
    main()

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

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

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

N = int(input())

total10 = 1
total9 = 1
total8 = 1

for i in range(N):
    total10 = (10*total10)%mod
    total9 = (9*total9)%mod
    total8 = (8*total8)%mod

if N ==2:
    print(2)
else:
    print((total10-2*total9+total8)%mod)

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

if N == 1:
  print(0)
else:
  a = 1
  b = 1
  c = 1
  for _ in range(N):
    a *= 10
    a %= mod
    b *= 9
    b %= mod
    c *= 8
    c %= mod
  
  ans = a % mod - (2 * b) % mod + c % mod
  print(ans % mod)

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

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

res = (a-2*b+c)%1000000007
print(res)

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

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

N = int(input())

mod = 1e9+7

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 = int(ans)
ans %= mod
if ans < 0:
    ans += mod

print(int(ans))

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

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

ALL = (10 ** n) % (10**9 +7)
wo_0 = (9 ** n) % (10**9 +7)
wo_9 = (9 ** n) % (10**9 +7)
wo_0_9 = (8 ** n) % (10**9 +7)

ans = (ALL - (wo_0 + wo_9 - wo_0_9)) % (10**9 +7)
print(ans)

Solution (Python):
def main():
	N = int(input())
	p = 1000000007
	ten = [10]
	nine = [9]
	eight = [8]
	for i in range(23):
		ten.append((ten[-1] ** 2) % p)
		nine.append((nine[-1] ** 2) % p)
		eight.append((eight[-1] ** 2) % p)

	t = 1
	n = 1
	e = 1

	b_N = format(N, 'b')
	for i in range(len(b_N)):
		if b_N[- 1 - i] == "1":
			t = (t * ten[i]) % p
			n = (n * nine[i]) % p
			e = (e * eight[i]) % p
	print((t - 2 * n + e) % p)

main()

Solution (Python):


N = int(input())

ron = 10 ** 9 + 7

a = (10 ** N) % ron

b = (9 ** N) % ron

c = (9 ** N) % ron 

bandc = (8 ** N) % ron

ans = (a - b - c + bandc) % ron

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

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

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

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

Solution (Python):
mod = 10**9 + 7
n = int(input())
def exp(x, k):
    exp = 1
    for _ in range(k):
        exp *= x
        exp %= mod
    return exp % mod
print((exp(10, n) - 2 * exp(9, n) + exp(8, n)) % mod)

Solution (Python):
import sys

MOD = 10**9 + 7


def main():
    N = int(sys.stdin.readline().rstrip())

    all_ = pow(10, N, MOD)
    ote = pow(8, N, MOD)
    otn = pow(9, N, MOD)
    zte = pow(9, N, MOD)

    ans = all_ - otn - zte + ote

    print(ans % MOD)


main()

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

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

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

print((A-2*B+C)%Mod)

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

mod = 10**9+7

all = 10**n 

yobun = 9**n + 9**n- 8**n

ans = all-yobun

print(ans % mod)

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 >>= 1
  return res

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

Solution (Python):
import math
from typing import List, Any


def read_int() -> int:
    return int(input().strip())


def read_ints() -> List[int]:
    return list(map(int, input().strip().split(' ')))

def modpow(base, p, modulo):
    answer = 1
    for _ in range(p):
        answer = (answer*base)%modulo
    return answer

def solve() -> Any:
    N = read_int()
    modulo = 10**9+7
    atleast = pow(10, N, modulo)-pow(9, N, modulo)
    answer = pow(8, N, modulo)+2*atleast-pow(10, N, modulo)
    return answer%modulo


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

Solution (Python):
import sys

N = int(sys.stdin.readline().strip())
mod = 10**9 + 7

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

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

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

a = 10 ** n
x = 8 ** n
y = 9 ** n

ans = (a - (y * 2 - x)) % mod

print(ans)

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

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

s = 1
z = 1
n = 1
zn = 1
e = 10 ** 9 + 7

for i in range(N):
    s = s * 10 % e
    z = z * 9 % e
    n = n * 9 % e
    zn = zn * 8 % e

result = s - z - n + zn

while result < 0:
    result += e

print(result)

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

mod = 10**9+7

x = 1
y = 1
z = 1

for i in range(N):
    x *= 10
    x %= mod
    y *= 9
    y %= mod
    z *= 8
    z %= mod

print((x-y-y+z)%mod)

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

Solution (Python):


n=int(input())




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

Solution (Python):
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
import copy


MOD = 10 ** 9 + 7



n = int(input())
a = pow(9, n, MOD)
b = pow(8, n, MOD)
c = pow(10, n, MOD)

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

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

r = 10**9 + 7


all = (10 ** N) % r
s1 = (9 ** N) % r
sn = (8 ** N) % r

ans = all - s1 - s1 + sn
ans %= r
print(ans)

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

mod = 10 ** 9 + 7

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

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

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

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

print(ans%mod)

Solution (Python):
n = int(input())
mod = 10**9 + 7
if n == 1:
    print(0)
    exit()
    
def fact(a, n): 
    ans = 1
    while n:
        if n % 2 == 1:
            ans = ans*a % mod
        a = a*a % mod
        n = n // 2
    return ans % mod


print( (fact(10, n)%mod - (fact(9, n)%mod * 2 - fact(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())
ans=1
MOD=10**9+7
a=1
b=1
c=1
for i in range(n):
    a*=10
    a%=MOD
    c*=8
    c%=MOD
for i in range(n):
    b*=9
    b%=MOD
print((a-b*2+c)%MOD)

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

all_combi = pow(10,n,10**9+7)

loss_1 = pow(9,n,10**9+7)
loss_2 = pow(8,n,10**9+7)
ans = (all_combi-2*loss_1+loss_2)%(10**9+7)

if ans < 0:
    ans += 10**9+7
print(ans)

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

p = 10 ** 9 + 7

dx = 1
d0 = 0
d9 = 0
da = 0
for i in range(N):
    nx = dx * 8
    n0 = d0 * 9 + dx
    n9 = d9 * 9 + dx
    na = da * 10 + d0 + d9

    dx = nx % p
    d0 = n0 % p
    d9 = n9 % p
    da = na % p

print(da)

Solution (Python):
N=int(input())
mod=10**9+7
if N==1:
  print(0)
  exit()
dp=[[0,0,0]for i in range(N-1)]
dp[0]=[64,34,2]
for i in range(N-2):
  dp[i+1][2]=dp[i][1]+dp[i][2]*10
  dp[i+1][1]=dp[i][0]*2+dp[i][1]*9
  dp[i+1][0]=dp[i][0]*8
  dp[i+1][2]%=mod
  dp[i+1][1]%=mod
  dp[i+1][0]%=mod
print(dp[-1][-1])

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

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

Solution (Python):
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


















def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


mod=1000000007
def combinations_count_mod(n, r):
    r = min(r, n - r)
    numer = reduce(lambda x,y: x*y%mod, range(n, n - r, -1), 1)
    denom = pow( reduce(lambda x,y: x*y%mod, range(1, r + 1), 1) , mod-2, mod)
    return numer * denom % mod


def solve():
    pass

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


if __name__ == '__main__':
    main()

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

if __name__ == "__main__":
    main()

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

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

print(ans%mod)

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

Solution (Python):





"""
"""

from collections import defaultdict
import bisect

import sys
input = sys.stdin.readline

modulo = (10**9)+7

def solve(n):
    pow9 = 1
    pow8 = 1
    pow7 = 1
    for _ in range(n):
        pow9 = pow9*10%modulo
        pow8 = pow8*9%modulo
        pow7 = pow7*8%modulo
    print((pow9-2*pow8+pow7)%modulo)
            

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


if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))



N = I()

val1 = pow(10,N,mod)
val2 = pow(9,N,mod)
val3 = pow(8,N,mod)

print((val1-2*val2+val3)%mod)

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

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

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

    all = 10**n % (10**9+7)

    no_zero = 9**n % (10**9+7)
    no_nine = no_zero

    no_nine_and_zero = 8**n % (10**9+7)

    print((all-no_nine-no_zero+no_nine_and_zero) % (10**9+7))

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

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

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

mod = 10 ** 9 + 7

or_zeronine = 9 ** N
and_zeronine  = 8 ** N
all_ = 10 ** N

ans = all_ - (or_zeronine*2-and_zeronine)

print(ans % mod)

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




INF = 10 ** 20
MOD = 10 ** 9 + 7


ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))
flush = lambda: sys.stdout.flush()



def main():
    n = ni()

    dp = [[0 for _ in range(4)] for __ in range(n + 1)]
    dp[0][0] = 1

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

        for j in range(4):
            dp[i + 1][j] %= MOD
    print(dp[n][3] % MOD)


if __name__ == '__main__':
    main()