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
u = pow(10, n, MOD)
v = pow(9, n, MOD)
w = pow(8, n, MOD)

print( (u - 2*v + w) % MOD)

Solution (Python):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
import random
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



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

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

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")

MOD = 1000000007


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


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

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

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

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):
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 = (ans+MOD)%MOD

print(ans)

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

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

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

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

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

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

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


N = int(input())
all = 1
no_1 = 1
no_1_and_9 = 1
mod = 10 ** 9 + 7

for _ in range(N):
  all *= 10
  all %= mod

  no_1 *= 9
  no_1 %= mod

  no_1_and_9 *= 8
  no_1_and_9 %= mod

print((all - (no_1 * 2 - no_1_and_9)) % mod)

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

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

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())
mod = int(1e9) + 7
def doubling(n, m):
    y = 1
    bas = n
    tmp = m
    while tmp:
        if tmp % 2:
            y *= bas
            y %= mod
        bas *= bas
        bas %= mod
        tmp >>= 1
    return y
d10 = doubling(10, N)
d9 = doubling(9, N)
d8 = doubling(8, N)
print((d10 - 2*d9 + d8) % mod)

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

Solution (Python):
mod = 1000000007
def ff(a, b):
  ans = 1
  while b:
    if b & 1: ans = ans * a % mod
    b >>= 1
    a = a * a % mod
  return ans
n=int(input())
print(((ff(10,n)-2*ff(9,n)+ff(8,n))%mod+mod)%mod)

Solution (Python):
mod = 1000000007
def ff(a, b):
  ans = 1
  while b:
    if b & 1: ans = ans * a % mod
    b >>= 1
    a = a * a % mod
  return ans
n=int(input())
print(((ff(10,n)-2*ff(9,n)+ff(8,n))%mod+mod)%mod)

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

Solution (Python):
'''
参考
https://qiita.com/u2dayo/items/98917c94c89c77b9b3a1
'''

MOD = 10 ** 9 + 7

N = int(input())

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

print(ans)

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

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

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

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):
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):
N = int(input())

mod = int(1000000007)


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

print(ans%mod)

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10**7)

ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

def modpow(n, p, m):
    if p == 0:
        return 1
    if p % 2 == 0:
        t = modpow(n, p // 2, m)
        return t * t % m
    return n * modpow(n, p - 1, m) % m

n = ni()

A = modpow(9, n, mod)
B = A
C = modpow(8, n, mod)
D = modpow(10, n, mod)

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

print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
r_1,r_2,r_3 = 1,1,1

for i in range(n):
    r_1 = r_1 * 10 % mod
    r_2 = r_2 * 9 % mod
    r_3 = r_3 * 8 % mod

print((r_1-r_2-r_2+r_3)%mod)

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

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

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

mod = 10 ** 9 + 7

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

print(ans)

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

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

Solution (Python):
def modpow(a, n, mod):
    res = 1
    while n:
        if n % 2:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


MOD = 1000000007

n = int(input())
ans = (modpow(10, n, MOD) - 2 * modpow(9, n, MOD) + modpow(8, 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 = int(1e9 + 7)

a, b, c = 1, 1, 1

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

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

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

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

print(ans%mod)

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):
num=int(input())
num2=[10, 9 ,8]



def multi(x):
	y=x**num
	return y


a, b, c=map(multi, num2)
print((a-2*b+c)%(int(1e9+7)))

Solution (Python):
num=int(input())
num2=[10, 9 ,8]

num2a=map(int, num2)

def multi(x):
	y=x**num
	return y


a, b, c=map(multi, num2a)
print((a-2*b+c)%(int(1e9+7)))

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

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

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

Solution (Python):
def main():
  N=int(input())
  m=int(1e9+7)
  print((pow(10,N,m)-pow(9,N,m)-pow(9,N,m)+pow(8,N,m))%m)
if __name__=='__main__':
  main()

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

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

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

MOD = 1000000007
whole = 10**n % MOD
bad = (9**n + 9**n - 8**n) % MOD
ans = (whole - bad) % MOD

print(ans)

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

Solution (Python):
import math

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

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

if n == 1:
    print(0)
elif n == 2:
    print(2)
else:
    x = (10 ** 9) + 7
    a = (10 ** n) % x
    b = (9 ** n) % x
    c = (8 ** n) % x
    y = a - b * 2 + c
    if y < 0:
        y += x
    y %= x
    print(y)

Solution (Python):
from sys import exit

def mod_pow(a, n, p):
    """累乗 O(logN)

    Args:
        a (int): 対象の値
        n (int): 指数
        p (int): 除数

    Returns:
        int: a^n mod p
    """
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % p
        a = a * a % p
        n >>= 1
    return res

def mod_comb_k(n, k, p):
    """二項係数 0(1)

    Args:
        n (int): 添字
        k (int): 添字
        p (int): 除数

    Returns:
        int: nCk mod p
    """
    if n < k or n < 0 or k < 0:
        return 0
    else:
        return fact[n] * fact_inv[k] * fact_inv[n-k] % p

def com_init(n, p):
    """二項係数の計算の前処理 O(N)

    Args:
        n (int): 上限値
        p (int): 除数
    """
    for i in range(n):
        fact.append(fact[-1] * (i+1) % p)

    fact_inv[-1] = pow(fact[-1], p-2, p)
    for i in range(n-1, -1, -1):
        fact_inv[i] = fact_inv[i+1] * (i+1) % p


n = int(input())

mod = 10 ** 9 + 7

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

res1 = mod_pow(10, n, mod)
res2 = mod_pow(8, n, mod)
res3 = 0
fact = [1]
fact_inv = [0] * (n+1)
com_init(n, mod)
for i in range(1, n+1):
    res3 = (res3 + mod_pow(8, n-i, mod) * mod_comb_k(n, i, mod) % mod) % mod
print(((res1 - res2) % mod - res3 * 2 % mod) % mod)

Solution (Python):
mod = 1000000007

n = int(input())

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

print(ans % mod)

Solution (Python):



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

Solution (Python):
def main():
    mod=1000000007
    n=int(input())
    if n==1:
        return 0
    
    inv=lambda x: pow(x,mod-2,mod)
    Fact=[1] 
    for i in range(1,n+1):
        Fact.append(Fact[i-1]*i%mod)
    Finv=[0]*(n+1) 
    Finv[-1]=inv(Fact[-1])
    for i in range(n-1,-1,-1):
        Finv[i]=Finv[i+1]*(i+1)%mod
    def comb(n,r):
        if n<r:
            return 0
        return Fact[n]*Finv[r]*Finv[n-r]%mod

    ans=0
    p=2**2
    others=pow(8,n-2,mod)
    for i in range(2,n+1):
        c=comb(n,i)
        ans+=(p-2)*others*c
        ans%=mod
        p*=2
        p%=mod
        others*=inv(8)
        others%=mod
    return ans

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

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

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

ans = (a + c - 2 * b) % 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))%(10**9+7))

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):
n = int(input())

div = 1000000000+7

p10 = pow(10,n)
p9 = pow(9,n)
p8 = pow(8,n)


ans = p10-2*p9+p8
ans %= div

print(ans)

Solution (Python):
N=int(input())
MOD=10**9+7
MAX=N+1
def powermod(base,ind):
  if ind==1:
    return base
  elif ind%2==0:
    return (powermod(base,ind//2)**2)%MOD
  else:
    return ((powermod(base,ind//2)**2)*base)%MOD

print((powermod(10,N)-2*powermod(9,N)+powermod(8,N))%MOD)

Solution (Python):

from sys import stdin
input = stdin.readline
MOD = 10**9+7

def main():
    n = int(input().strip())
    buf = 9**n
    ans = 10**n - buf - buf + 8**n
    print(ans%MOD)

if __name__ == "__main__":
    main()

Solution (Python):

from sys import stdin
input = stdin.readline
MOD = 10**9+7

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

if __name__ == "__main__":
    main()

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

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

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

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

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

Solution (Python):
N = int(input())
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

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

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

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

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

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

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

c = 10**n - (2*9**n - 8**n)
r = c % mod
print(r)

Solution (Python):
n = int(input())
state10 = 1
state9 = 1
state8 = 1
mod = 10**9 + 7
for _ in range(n):
  state10 *= 10
  state10 %= mod
  state9 *= 9
  state9 %= mod
  state8 *= 8
  state8 %= mod

ans = state10 - 2*state9 + state8
ans %= mod
print(ans)

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

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

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

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

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

Solution (Python):
from sys import stdin

input = stdin.readline

MOD = 10**9 + 7



def solve():
    n = int(input())
    print((pow(10,n,MOD) - pow(9,n,MOD) * 2 + pow(8,n,MOD))%MOD)

if __name__ == '__main__':
    solve()

Solution (Python):
mod = 1000000007


def fexp(x, y):
    ans = 1
    while y > 0:
        if y % 2 == 1:
            ans = ans * x % mod
        x = x * x % mod
        y //= 2
    return ans


n = int(input())
ans = fexp(10, n) - 2 * fexp(9, n) + fexp(8, n)
ans %= mod
if ans < 0:
    ans += mod
print(ans)

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

div = 10**9 + 7

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

print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):






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


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

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N = int(readline())
    K = int(1e9) + 7
    ans = pow(10, N, K) - pow(9, N, K) - pow(9, N, K) + pow(8, N, K)
    print(ans%K)
if __name__ == '__main__':
    main()

Solution (Python):
def f(n):
    mod = 1000000007
    return (pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)) % mod

n = int(input())
print(f(n))

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

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

Solution (Python):


import sys

input = iter(sys.stdin.read().splitlines()).__next__

MOD = 1000000007

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

N = int(input())

total = powmod(10, N)



cnt_without0 = powmod(9, N)
cnt_without9 = cnt_without0
cnt_without0nor9 =  powmod(8, N)

res = (total - cnt_without0 - cnt_without9 + cnt_without0nor9) % MOD
if res < 0:
   res += MOD

print(res)

Solution (Python):
def solve(n):
    a, b, c, m = 1, 1, 1, 1
    mod = 1000000007
    while n > 0:
        if n & 1:
            a = (a * 10 ** m) % mod
            b = (b * 9 ** m) % mod
            c = (c * 8 ** m) % mod
        n >>= 1
        m *= 2
    print((a - 2*b + c) % mod)

solve(int(input()))

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

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

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

def powmod(x, y, d):
    ret = 1
    for _ in range(1, y+1):
        ret = ret * x % d
    return ret
ans = powmod(10, N, 10**9+7) - powmod(9, N, 10**9+7)*2 + powmod(8, N, 10**9+7)

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

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

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

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

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

else:
  a=(((10)**N)%(((10)**9)+7))
  b=(((8)**N)%(((10)**9)+7))
  c=(((9)**N)%(((10)**9)+7))
  d=((c*2)%(((10)**9)+7))
  f=((a+b-d)%(((10)**9)+7))
  print(f)

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

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

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
readline = sys.stdin.buffer.readline
read = sys.stdin.readline  
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))



def a_int(): return int(readline())


def ints(): return list(map(int, readline().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    ret = []
    for _ in range(H):
        ret.append(list(map(int, readline().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, readline().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, readline().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  
from functools import reduce
from math import gcd


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






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

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

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

def powmod(x, y):
    ret = 1
    for _ in range(1, y+1):
        ret = ret * x % (10**9+7)
    return ret
ans = powmod(10, N) - powmod(9, N)*2 + powmod(8, N)
print(ans % (10**9+7))

Solution (Python):





















import math
import copy
import string



INF = int(10**18) 
pi = math.pi

MOD = 1000000007








def my_pow(N, a, M):
    if(a == 0):
        return 1
    else:
        if(a % 2 == 0):
            tempo = my_pow(N, a/2, M)
            return (tempo * tempo) % M
        else:
            tempo = my_pow(N, a - 1, M)
            return (tempo * N) % M





def my_combination(N, a, M):
    res = 1

    for i in range(0, a):
        res *= N - i
        res %= M

    for i in range(0, a):
        res *= my_pow(i + 1, M - 2, M)
        res %= M

    return res





def my_combination_table(N, M, v):
    if(len(v) < N + 1):
        l = N + 1 - len(v)
        tempo = [1] * l
        v.extend(tempo)

    for i in range(1, N + 1):
        v[i] = v[i - 1] * (N - (i - 1))
        v[i] %= M

        v[i] *= my_pow(i, M - 2, M)
        v[i] %= M

    return










N = int(input())
res = 10 ** N - 2 * (9 ** N) + 8 ** N
res %= MOD

print(res)

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

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

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):
import numpy as np

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

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

def pow(n, num):
  s = num
  for i in range(1,n):
    s = s*num%mod
  return s
print((pow(n,10) - 2*pow(n,9) + pow(n,8))%mod)

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

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

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

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

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

all_result = 10 ** n
nothing = 8 ** n
only_1 = 9 ** n

result = all_result + nothing - 2 * only_1

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

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

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import defaultdict
from collections import deque
import bisect
from decimal import *
def main():
    N = I()
    mod = 10 ** 9 + 7
    print((pow(10, N, mod) - (2 * pow(9, N, mod) % mod) + pow(8, N, mod)) % mod)
if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
mod = 10 ** 9 + 7
start,zero,nine,ans = 1,0,0,0
for i in range(n):
  ans = (ans * 10 + zero + nine) % mod
  zero = (zero * 9 + start) % mod
  nine = (nine * 9 + start) % mod
  start = (start * 8) % mod
print(ans)

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
dp = [[0] * 4 for i in range(N+1)]
MOD = 10**9+7
dp[0][0] = 1
for i in range(1,N+1):
    dp[i][0] = (dp[i-1][0] * 8) % MOD
    dp[i][1] = (dp[i-1][0] + dp[i-1][1]*9) % MOD
    dp[i][2] = (dp[i-1][0] + dp[i-1][2]*9) % MOD 
    dp[i][3] = (dp[i-1][3]*10 + dp[i-1][1] + dp[i-1][2]) % MOD

print(dp[N][3])

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

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

mod = 10**9+7 
"""
N = 10**6
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
"""
a = ans%mod
print(a)

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

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

p_all = 10 ** N
p_no0 = 9 ** N
p_no9 = 9 ** N
p_no09 = 8 ** N

ans = (p_all - p_no0 - p_no9 + p_no09) % (10 ** 9 + 7)

print(ans)

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

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

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

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

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

Solution (Python):
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]
mod = 10**9+7
n = I()
if n == 1:
  print(0)
else:
  
  print((10**n-2*9**n+8**n)%mod)

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

N = int(input())

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

print(ans)

Solution (Python):

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

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

print(answer % MOD)