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

from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, heapify
import copy
import sys
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


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





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




def I(): return int(sys.stdin.buffer.readline())





def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()




def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')







def IR(n): return [I() for i in range(n)]







def LIR(n): return [LI() for i in range(n)]







def SR(n): return [S() for i in range(n)]







def LSR(n): return [LS() for i in range(n)]







def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    
    print((pow(n, 10) - (pow(n, 9) + pow(n, 9) - pow(n, 8))) % mod)
    
    
    

    


def pow(n, num):
    s = num
    for i in range(1, n):
        s = s * num % mod
    return s











if __name__ == "__main__":
    main()

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

A = 9**M
a = int(A)
B = 9**M
b = int(B)
C = 8**M
c = int(C)
D = a+b-c
d = int(D)
E = 10**M
e = int(E)
F = e-d
f = int(F)

if M==0:
    print(0)

elif M==1:
    print(0)

elif M==2:
    print(2)

elif M>=3:
    print(f%(10**9+7))

Solution (Python):

import sys

MOD = 1000000007  


def solve(N: int):
    return print((10**N - 2*9**N + 8**N)%MOD)


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

if __name__ == '__main__':
    main()

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

MOD = 10**9 + 7

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

Solution (Python):
n = int(input())
p = 10 ** 9 + 7
a = 1
b = 1
c = 1
for i in range(n):
    a = (a * 10) % p
    b = (b * 9) % p
    c = (c * 8) % p
y = a - 2 * b + c
if y < 0:
    while y < 0:
        y += p
elif y > p:
    while y > p:
        y -= p
print(y)

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

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

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

Solution (Python):

N = int(input())
nasi = 10**N - 9**N - 9**N + 8**N
wari = 10**9 + 7
ans = nasi % wari
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 = 10**9+7

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

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

print(ans)

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

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

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

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

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

print(ans)

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

import sys,io,os,time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline




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





'''


import collections,sys,threading
sys.setrecursionlimit(10**9)
threading.stack_size(10**8)



threading.Thread(target=solve).start()
'''

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

n10 = pow(10, n, mod)
n9 = pow(9, n, mod)
n8 = pow(8, n, mod)
ans = 2 * (n10 - n9) - (n10 - n8)
ans %= mod

print(ans)

Solution (Python):
def c_ubiquity(MOD=10**9 + 7):
    N = int(input())
    def calc(k): return pow(k, N, MOD)
    return (calc(10) - 2 * calc(9) + calc(8)) % MOD

print(c_ubiquity())

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt, factorial
from copy import deepcopy
 
def main():
    n = int(input()) 
    ans = (10**n) - 2*(9**n) + (8**n) 
    print(ans%(10**9+7))
    

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

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

mod = 10 ** 9 + 7

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):


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

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

mod = 10 ** 9 + 7

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

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

Solution (Python):

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

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

    print(ans % MOD)


if __name__ == "__main__":
    resolve()

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

d = 1
q = 1
o = 1
for i in range(n):
  d = (d * 10) % m
  q = (q * 9) % m
  o = (o * 8) % m

print((d-q-q+o)%m)

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

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

Solution (Python):
import sys

input=sys.stdin.buffer.readline





def RD(): return sys.stdin.read()


def II(): return int(input())


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


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))





def main():
	n=II()
	a=pow(10,n,10**9+7)
	b=pow(9,n,10**9+7)
	c=pow(8,n,10**9+7)
	print((a-2*b+c)%(10**9+7))
	

if __name__=="__main__":
	main()

Solution (Python):
N = int(input())
mod = 10**9 + 7
if N < 2:
    print(0)
    exit()
all = pow(10, N, mod)

sabun = pow(9, N, mod) * 2 - pow(8, N, mod)
ans = ((all % mod) - sabun) % mod
print(ans)

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

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

Solution (Python):
N = int(input())
mod = 10**9 +7
def fur(n,r):
    p,q = 1,1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(i+1)%mod
    return p * pow(q,mod-2,mod) % mod
ans = (10**N) - (-8**N +9**N + 9**N)
print(int(ans%mod))

Solution (Python):
mod = int(1e9+7)
n = int(input())
ans1 = 1
ans2 = 1
ans3 = 1
for i in range(n):
    ans1 *= 10
    ans1 %= mod
    ans2 *= 9
    ans2 %= mod
    ans3 *= 8
    ans3 %= mod

ans = ans1 - 2*ans2 + ans3

print(ans%mod)

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

Solution (Python):
N = int(input())
TEN = 1
NINE = 1
EIGHT = 1
a = 10
b = 9
c = 8

mod = 10 ** 9 + 7

for i in range(64):
    if N % 2:
        TEN *= a
        TEN %= mod
        NINE *= b
        NINE %= mod
        EIGHT *= c
        EIGHT %= mod
    N //= 2
    a *= a
    a %= mod
    b *= b
    b %= mod
    c *= c
    c %= mod

print((TEN - 2 * NINE + EIGHT + mod * 2)%mod)

Solution (Python):


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

ans = 10**N - 9**N - 9**N + 8**N
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 math

N = int(input())

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

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

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

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






MAX = 10 ** 9 + 7
result = pow(10, N, MAX) - pow(9, N, MAX) - pow(9, N, MAX) + pow(8, N, MAX)

print(result % MAX)

Solution (Python):
MOD = 1000000007
def powmod(x, y):
  res = 1
  for i in range(y):
    res = res * x % MOD
  return res

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

Solution (Python):
import sys
from functools import reduce
from operator import mul
from typing import Callable, ClassVar, Sequence, Type, TypeVar


T = TypeVar('T', bound='ModIntBase')


class ModIntBase:
    value: int
    mod: ClassVar[int]
    fac: ClassVar[Sequence[int]] = ()
    inv: ClassVar[Sequence[int]] = ()
    finv: ClassVar[Sequence[int]] = ()

    def __init__(self, value: int) -> None:
        self.value = value % self.mod

    def __hash__(self) -> int:
        return hash((self.value, self.mod))

    def __eq__(self, other) -> bool:
        if isinstance(other, self.__class__):
            return self.value == other.value
        else:
            return NotImplemented

    def __ne__(self, other) -> bool:
        if isinstance(other, self.__class__):
            return self.value != other.value
        else:
            return NotImplemented

    
    def __add__(self, other):
        if isinstance(other, self.__class__):
            return self.__class__((self.value + other.value) % self.mod)
        else:
            return NotImplemented

    def __sub__(self, other):
        if isinstance(other, self.__class__):
            return self.__class__((self.value - other.value) % self.mod)
        else:
            return NotImplemented

    def __mul__(self, other):
        if isinstance(other, self.__class__):
            return self.__class__(self.value * other.value % self.mod)
        else:
            return NotImplemented

    def __truediv__(self, other):
        if isinstance(other, self.__class__):
            a = other.value
            b = self.mod
            u = 1
            v = 0
            while b:
                t = a // b
                a, b = b, a - t * b
                u, v = v, u - t * v
            return self.__class__(self.value * u % self.mod)
        else:
            return NotImplemented

    def __pow__(self, other):
        if isinstance(other, self.__class__):
            v = 1
            a = self.value
            b = other.value
            mod = self.mod
            while b > 0:
                if b & 1:
                    v = v * a % mod
                a = a * a % mod
                b >>= 1
            return self.__class__(v)
        else:
            return NotImplemented

    @classmethod
    def comb(cls, n: int, k: int):
        if n < k:
            return cls(0)
        if n < 0 or k < 0:
            return cls(0)

        if n < len(cls.fac):
            return cls(cls.fac[n] * (cls.finv[k] * cls.finv[n - k] % cls.mod) % cls.mod)
        else:
            k = min(k, n - k)
            a = reduce(mul, map(cls, range(n - k + 1, n + 1)), cls(1))
            b = reduce(mul, map(cls, range(1, k + 1)), cls(1))
            return a / b

    def __repr__(self) -> str:
        return f'{self.__class__.__name__}({self.value!r})'

    def __str__(self) -> str:
        return str(self.value)


def mod_comb_init(max_: int) -> Callable[[Type[T]], Type[T]]:
    def _mod_comb_init(cls: Type[T]) -> Type[T]:
        mod: int = cls.mod
        assert max_ < mod

        fac = cls.fac = [0] * max_
        finv = cls.finv = [0] * max_
        inv = cls.inv = [0] * max_

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

        return cls
    return _mod_comb_init


class ModInt(ModIntBase):
    mod = 1000000007  


def resolve(in_):
    N = int(next(in_))

    a = ModInt(10) ** ModInt(N)
    b = ModInt(9) ** ModInt(N)
    c = ModInt(8) ** ModInt(N)

    ans = a - b * ModInt(2) + c
    return ans
    

def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

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

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

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

mod=pow(10,9)+7

def pow_method(r,N):
    ans=1
    for i in range(N):
        ans=ans*r%mod
    return ans

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

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)

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


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


if __name__ == '__main__':
    main()

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

Solution (Python):

import math

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

ans = (10 ** N) % MOD - (9 ** N) % MOD -(9 ** N) % MOD + (8 ** N) % MOD
while ans < 0: ans += MOD

print(ans % MOD)

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

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

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

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

if N==1:
    out=0
elif N==2:
    out=2

else:
    out=(10**N - (9**N + 9**N - 8**N)) % (10**9 + 7)

print(out)

Solution (Python):


import sys

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

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

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

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

dp[2][0] = 64
dp[2][1] = 17
dp[2][2] = 17
dp[2][3] = 2
for i in range(2, n):
    dp[i+1][3] = ((dp[i][1] + dp[i][2]) % mod + dp[i][3]*10 % mod) % mod

    dp[i+1][1] = (dp[i][0] + dp[i][1]*9 % mod) % mod

    dp[i+1][2] = (dp[i][0] + dp[i][2]*9 % mod) % mod

    dp[i+1][0] = (dp[i][0]*8) % mod
print(dp[n][3])

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

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

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

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

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

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

Solution (Python):
n=int(input())
mod=10**9+7
e=pow(8,n,mod)
f=pow(9,n,mod)

g=pow(10,n,mod)
print((g-2*f+e)%mod)

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

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

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


if __name__ == '__main__':
    main()

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





sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    ret = (pow(10, N, MOD) - pow(9, N, MOD) - pow(9, N, MOD) + pow(8, N, MOD)) % MOD
    print(ret)


if __name__ == '__main__':
    main()

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

N = int(input())

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

print(ans)

Solution (Python):
n = int(input())
inf = 1000000000 + 7
a=1; b=1;c=1
if n==2: ans=2
elif n==1: ans=0
elif n>2:
    for i in range(n):
        a = (10*a) % inf
        b = (9*b) % inf
        c = (8*c) % inf
    ans = int(a%inf - int(2*b)%inf + int(c)%inf)%inf
print(int(ans))

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

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

mod = 10 ** 9 + 7


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


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

print(ans % mod)

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

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

print(ans % M)

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

a=1
b=1
c=1

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

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

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

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

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

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

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

Solution (Python):


n = int(input())

mod = 10**9 + 7
ans = 0
ans += 10**n % mod
ans -= 2*9**n % mod
ans += 8**n % mod

print(ans % mod)

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

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    ans = pow(10, n, MOD)
    ans -= 2 * pow(9, n, MOD)
    ans += pow(8, n, MOD)
    print(ans % MOD)
resolve()

Solution (Python):
from sys import stdin

readline = stdin.buffer.readline
read = stdin.buffer.read
def i_input(): return int(input().rstrip())
def i_map(): return map(int, input().rstrip().split())
def i_list(): return list(i_map())

MOD = 10 ** 9 + 7
def main():
    N = i_input()
    print((pow(10, N, MOD) - pow(9, N, MOD) * 2 + pow(8, N, MOD)) % MOD)

if __name__ == "__main__":
    main()

Solution (Python):


def f(n: int) -> int:
    """
    >>> f(1)
    0
    >>> f(2)
    2
    >>> f(869121)
    2511445
    """
    return (10 ** n - 9 ** n - 9 ** n + 8 ** n) % (10 ** 9 + 7)


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

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

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

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

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

e = pow(8, N, mod)
f = pow(9, N, mod)
g = pow(10, N, mod)


ans = (g - 2 * f + e) % mod
print(ans)

Solution (Python):

import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

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

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

def pow_by_iter(a, x, p):
    acc = a
    for i in range(1, x):
        acc = (acc * a) % p
    return acc

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

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

x = 10**n%mod
y = 2*9**n%mod - 8**n%mod
print((x-y)%mod)

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

def powmod(x, y):
    num = 1
    for i in range(y):
        num = num * x % (10**9+7)
    return num

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

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

Solution (Python):
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
import itertools
import math
from operator import mul
from functools import reduce

mod = 10 ** 9 + 7

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

print(ans)

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

Solution (Python):
def mypow(x,k,p):
    out = 1
    while(k > 0):
        if(k%2 == 1):
            out = out * x % p
        k = k // 2
        x *= x
    return out

p = 10 ** 9 + 7
n = int(input())
res = (mypow(10,n,p) - mypow(9,n,p)*2 + mypow(8,n,p)) % p
print(res)

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

mod = (10**9)+7

if n == 1:
    print(0)
elif n==2:
    print(2)
else:
    t = (10**n)
    tmp = (9**n)
    non = (8**n)
    print((t+non-tmp*2)%mod)

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

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

Solution (Python):
import math

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

df = (10 ** n) - (2 * 9 ** n - 8 ** n)

print(df % inf)

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

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

Solution (Python):
import math

n = int(input())

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

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

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


def get_output(n):
    if n <= 1:
        return 0
    if n <= 2:
        return n
    return (10**n - 9**n - 9**n + 8**n) % 1000000007


print(get_output(N))

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

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

print(ans)

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

mod = pow(10, 9) + 7

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

Solution (Python):
"""
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""


n = int(input())
mod = 1000000007
tmp = (10**n)%mod
diff = 2*(9**n)%mod
eight = (8**n)%mod

ans = tmp - diff + eight
ans%=mod
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline  
N = int(input())
mod =10**9 +7
ans =0
if N ==1:
    ans =0
elif N ==2:
    ans =2
else:
    ans =(10**N -9**N -9**N +8**N ) %mod
print(ans)

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

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
def mpow(x,n):
    return x**n % mod

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

Solution (Python):

import sys
sys.setrecursionlimit(1000000)
from collections import deque


N = int(input())

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

Solution (Python):
def pow_k(x, n,mod = 10**9+7):
    res = 1
    for i in range(0,n):
        res = res * x % mod

    return res

def solve(n,mod = 10**9+7):
    total = pow_k(10,n)
    not_include_0 = pow_k(9,n)
    not_include_9 = not_include_0
    not_include_0_and_9 = pow_k(8,n)
    return (total%mod-(not_include_0 + not_include_9 - not_include_0_and_9)%mod)%mod

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

if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):

import sys

MOD = 1000000007  


def solve(N: int):
    if N == 1:
        print(0)
        return
    if N == 2:
        print(2)
        return
    ans = (10 ** N) - ((9 ** N )* 2) + (8 ** N)
    print(ans % MOD)



    return



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

if __name__ == '__main__':
    main()

Solution (Python):
I=lambda:int(input())

n=I()
mod=10**9+7
tens=pow(10,n,mod)
nines=pow(9,n,mod)
eights=pow(8,n,mod)
ans=(tens-(nines*2-eights))%mod
print(ans)

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

mod = 10**9+7

def powmod(x, y):
    a = 1
    for _ in range(y):
        a *= x
        a %= mod
    return a


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


if __name__ == "__main__":
    main()

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


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

Solution (Python):
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    def nCr(n,r):
        mod = 10 ** 9 + 7
        a = b = 1
        for i in range(r):
            a = (a * (n - i)) % mod
            b = (b * (r - i)) % mod
        return (a * pow(b,mod-2,mod))%mod

    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)

if __name__ == "__main__":
    main()

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

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

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

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

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

n = int(input())
print((pow(10, max(n, 0), MOD) - 2*pow(9, max(n, 0), MOD) + pow(8, max(n, 0), MOD)) % MOD)

Solution (Python):
n = int(input())
j = q = h = 1
rem = 10**9+7
for i in range(n):
    j *= 10
    j %= rem
    q *= 9
    q %= rem
    h *= 8
    h %= rem
print((j-q*2+h)%rem)

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

Solution (Python):
N = int(input())
ans=1
num=1
ans1=1
a=(10**9)+7
for i in range(N):
    ans*=10
    ans=ans%a
    num*=9
    num=num%a
    
for i in range(N):
    ans1*=8
    ans1=ans1%a


print((ans-2*num+ans1)%(10**9+7))

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

Solution (Python):
import sys
from sys import stdin,stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache

try:
    m=(10**9+7)
    for _ in range(1):
        n=int(input())
        if n==1:
            print(0)
        elif n==2:
            print(2)
        else:
            print((((pow(10,n,m)-(2*pow(9,n,m)))%m)+pow(8,n,m))%m)
            
            


    
except EOFError as e:
    print(e)

Solution (Python):




def input_int():
    return int(input())



def int1(x):
    return int(x) - 1



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



def input_to_int_tuple():
    return tuple(map(int, input().split()))



def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    MOD = (10 ** 9) + 7

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

if __name__ == "__main__":
    main()

Solution (Python):

import math
N = int(input())
a = 10**9+7

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





print(ans%a)

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

mod = 7 + 10 ** 9

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

Solution (Python):
N = int(input())
div = 1000000007
a = N % div
a = a * (a-1) % div
a = pow(10, N) % div
b = pow(9, N) % div * 2 % div
c = pow(8, N)

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