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 sys import stdin


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


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


if __name__ == "__main__":
    main()

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

def f(num):
    return pow(num, n, MOD)

print((f(10)-f(9)-f(9)+f(8))%MOD)

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

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

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

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

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

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

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

Solution (Python):
N=int(input())
mod=10**9+7
t=0
a,b,c=1,1,1
for i in range(N):
    a*=10
    b*=9
    c*=8
    if i%10==0:
        a%=mod
        b%=mod
        c%=mod
ans=(a+c-(2*b))%mod
print(ans)

Solution (Python):
N=int(input())
mod=10**9+7
t=0
a,b,c=1,1,1
for i in range(N):
    a*=10
    b*=9
    c*=8
    if i%10==0:
        a%=mod
        b%=mod
        c%=mod
ans=(a+c-(2*b))%mod
print(ans)

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())
dp = [0 for j in range(4)]
dp[0] = 1
M = 1_000_000_007;
for i in range(N):
    x = dp[0]
    y = dp[1]
    z = dp[2]
    dp[0] = (x * 8) % M
    dp[1] = (y * 9 + x) % M
    dp[2] = (z * 9 + x) % M
    dp[3] = (dp[3] * 10 + y + z) % M
print(dp[3])

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

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

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

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
z = y % p
print(z)

Solution (Python):
def main():
  mod=10**9+7
  n=int(input())
  dp=[[0]*(n+1) for _ in range(4)]
  dp[0][0]=1
  for i in range(4):
    for j in range(n):
      dp[i][j]%=mod
      dp[i][j+1]+=dp[i][j]*8
      dp[i|1][j+1]+=dp[i][j]
      dp[i|2][j+1]+=dp[i][j]
  print(dp[3][n]%mod)
main()

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

print(ans)

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

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


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


if __name__ == "__main__":
    solve()

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

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

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

Solution (Python):
'''
Created on 2020/09/14

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin())
  mod=10**9+7
  if N==1:
    print(0)
  elif N==2:
    print(2)
  else:
    ans1=1 
    ans0=1  
    ans2=1 
    for i in range(N):
      ans1=(ans1*10)%mod 
      ans0=(ans0*9)%mod 
      ans2=(ans2*8)%mod 
    ans=(ans1-2*ans0+ans2)%mod
    print(ans)
  return
main()

Solution (Python):

import sys
input = sys.stdin.readline
from bisect import bisect_left;
from bisect import bisect_right;
from math import ceil, factorial;

def ceil(x):
    if x != int(x):
        x = int(x) + 1;
    return x;
    

def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;


def gcd(a,b):
    if b == 0:
        return a;
    return gcd(b, a % b);


def nCr(n, k): 
    if(k > n - k): 
        k = n - k; 
    res = 1;
    for i in range(k): 
        res = res * (n - i);
        res = res / (i + 1); 
    return int(res);


def primefs(n):
    
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    
    
    return primes


def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 


def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;









def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;




def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x


def sieve(n): 
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime


MAXN = int(1e5 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    




def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret;
    
    


def int_array():
    return list(map(int, input().strip().split()));

def float_array():
    return list(map(float, input().strip().split()));


def str_array():
    return input().strip().split();


MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');



n = int(input());

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

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

Solution (Python):
N = int(input())
MOD = 10 ** 9 + 7
if N == 1:
  print(0)
  exit()
a = pow(10, N, MOD)
b = pow(9, N, MOD)
c = pow(8, N, MOD)
ans = (a - (2 * b) + c) % MOD
if ans < 0:
  ans += MOD
print(ans)

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

N = int(input())

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

print(ans)

Solution (Python):
import math

mod = 10**9 + 7

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

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

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

print(ans%MOD)

Solution (Python):
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline

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

dp = [[0 for _ in range(N + 3)] for _ in range(4)]
dp[0][0] = 1

for i in range(1, N +  1):
    dp[0][i] = (dp[0][i - 1] * 8) % MOD
    dp[1][i] = (dp[0][i - 1] * 1 + dp[1][i - 1] * 9) % MOD
    dp[2][i] = (dp[0][i - 1] * 1 + dp[2][i - 1] * 9) % MOD
    dp[3][i] = (dp[1][i - 1] * 1 + dp[2][i - 1] * 1 + dp[3][i - 1] * 10) % MOD
    
print(dp[3][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())
waru = 10**9+7

nmod = pow(10,n,waru)


n1mod = pow(9,n,waru)*2


nnmod = pow(8,n,waru)

ans = (nmod-n1mod+nnmod) % waru
print(ans)

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

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

print(ans)

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
import math
sys.setrecursionlimit(10**6)

MOD = 10**9+7


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

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


if __name__ == '__main__':
    main(sys.stdin.readline, print)

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

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

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

N = int(readline())

DIV = 10 ** 9 + 7

dp = [[0] * 4 for i in range(N + 1)]

dp[0][0] = 1

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

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):
import sys
import math
input = sys.stdin.readline

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


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


if __name__ == '__main__':
    solve()

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
readline=sys.stdin.readline

N = int(readline())

DIV = 10 ** 9 + 7

dp = [[0] * 4 for i in range(N + 1)]

dp[0][0] = 1

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

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

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

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

N = int(readline())

DIV = 10 ** 9 + 7



dp = [[[0] * 2 for j in range(2)] for i in range(N + 1)]

dp[0][0][0] = 1

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

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

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

N = int(readline())

DIV = 10 ** 9 + 7

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    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())
MOD = 10**9+7

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

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

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

class Combination:
    def __init__(self, size):
        self.size = size + 2
        self.fact = [1, 1] + [0] * size
        self.factInv = [1, 1] + [0] * size
        self.inv = [0, 1] + [0] * size

        for i in range(2, self.size):
            self.fact[i] = self.fact[i - 1] * i % MOD
            self.inv[i] = -self.inv[MOD % i] * (MOD // i) % MOD
            self.factInv[i] = self.factInv[i - 1] * self.inv[i] % MOD

    def npr(self, n, r):
        if n < r or n < 0 or r < 0:
            return 0
        return self.fact[n] * self.factInv[n - r] % MOD

    def ncr(self, n, r):
        if n < r or n < 0 or r < 0:
            return 0
        return self.fact[n] * (self.factInv[r] * self.factInv[n - r] % MOD) % MOD

    def nhr(self, n, r):  
        return self.ncr(n + r - 1, n - 1)

N = int(input())
comb = Combination(N + 10)

dis = 0
for i in range(1, N + 1):
    dis += comb.ncr(N, i) * 2 * pow(8, N - i, MOD)
    dis %= MOD
ans = pow(10, N, MOD) - dis - pow(8, N, MOD)
print(ans % MOD)

Solution (Python):
def main():
    n = int(input())
    mod = 10 ** 9 + 7 
    
    def modpow(x, n, mod):
        res = 1
        while n:
            if n % 2:
                res *= x % mod
                res %= mod
            x *= x % mod
            n >>= 1
        return res
 
    
    all_p = modpow(10, n, mod)
    
    not_0 = modpow(9, n, mod)
    
    not_9 = modpow(9, n, mod)
    
    not_0_9 = modpow(8, n, mod)
    
    ans = (all_p - not_0 - not_9 + not_0_9) % mod
    print(ans)
 
if __name__ == '__main__':
    main()

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


in0 = 10**N - 9**N

in9 = 10**N - 9**N

not0and9 = 10**N - 8**N

answer = in0 + in9 - not0and9

print(answer%MOD)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
import random
import string
from copy import deepcopy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

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





N = getN()
logk = N.bit_length()



dp = [[[0, 0, 0, 0] for i in range(4)] for i in range(logk)]
dp[0] = [[8, 1, 1, 0], [0, 9, 0, 1], [0, 0, 9, 1], [0, 0, 0, 10]]


def array_cnt(ar1, ar2):
    h = len(ar1)
    w = len(ar2[0])
    row = ar1
    col = []
    for j in range(w):
        opt = []
        for i in range(len(ar2)):
            opt.append(ar2[i][j])
        col.append(opt)

    res = [[[0, 0] for i in range(w)] for i in range(h)]
    for i in range(h):
        for j in range(w):
            cnt = 0
            for x, y in zip(row[i], col[j]):
                cnt += x * y
            res[i][j] = cnt
            res[i][j] %= mod
    return res

for i in range(1, logk):
    dp[i] = array_cnt(dp[i - 1], dp[i - 1])

ans = [[1, 0, 0, 0]]
for i in range(logk):
    if N & (1 << i):
        ans = array_cnt(ans, dp[i])
        
print(ans[0][-1] % mod)

Solution (Python):
def main():
    n = int(input())
    mod = 10 ** 9 + 7 
    
    def modpow(x, n, mod):
        res = 1
        while n:
            if n % 2:
                res *= x % mod
            x *= x % mod
            n >>= 1
        return res
 
    
    all_p = modpow(10, n, mod)
    
    not_0 = modpow(9, n, mod)
    
    not_9 = modpow(9, n, mod)
    
    not_0_9 = modpow(8, n, mod)
    
    ans = (all_p - not_0 - not_9 + not_0_9) % mod
    print(ans)
 
if __name__ == '__main__':
    main()

Solution (Python):
def bekijou(a,x):
  MOD = 1000000007
  ret = 1
  for _ in range(x):
    ret *= a
    ret %= MOD
  return ret
    
n=int(input())
MOD = 1000000007
ret = (bekijou(10,n)+MOD-((2*bekijou(9,n)) % MOD)+bekijou(8,n))%MOD
print(ret)

Solution (Python):
def main():
    n = int(input())
    mod = 10 ** 9 + 7 
    
    def modpow(x, n, mod):
        res = 1
        while n:
            if n % 2:
                res *= x % mod
                res %= mod
            x *= x % mod
            n >>= 1
        return res

    
    all_p = modpow(10, n, mod)
    
    not_0 = modpow(9, n, mod)
    
    not_9 = modpow(9, n, mod)
    
    not_0_9 = modpow(8, n, mod)
    
    ans = all_p - not_0 - not_9 + not_0_9
    print(ans%mod)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



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

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
from sys import stdin,stdout
M=10**9+7
n=int(stdin.readline())



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

Solution (Python):








import math,sys
P = 1000000007









N = int(sys.stdin.readline())
print((pow(10,N,P)-pow(9,N,P)-pow(9,N,P)+pow(8,N,P))%P)

Solution (Python):
import sys
import math


sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

MOD = 1000000000 + 7

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

    return res

N = ini()

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

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

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

Solution (Python):

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


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

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

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

mod = 10**9+7


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

print(int(x)%mod)

Solution (Python):

from sys import stdin, stdout



def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)

mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}

def solve(n):
	return (((10**n) + (8**n)) - ((9**n)*2)) %(10**9+7)

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

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

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

Solution (Python):

import os
import sys

from collections import *


from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
ALPHA='abcdefghijklmnopqrstuvwxyz'
M=10**9+7
EPS=1e-6
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]






n=Int()

tot=pow(10,n,M)
no9no0=pow(8,n,M)
no9but0=(pow(9,n,M)-pow(8,n,M)+M)%M
no0but9=no9but0

ans=(tot-no9but0-no9no0-no0but9)%M
print(ans)

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

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

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

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

Solution (Python):
N = int(input())
 
 
def ruizyou(x, n, S=1):
    
    S = 1
    for _ in range(n):
        S = (S*x)%(1e9+7)
    
    return S
    
a = int( ruizyou(10, N) + ruizyou(8, N) - ruizyou(9, N)*2 )
 
print(int(a%(1e9+7)))

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):
from math import factorial as f
n = int(input())
ans = 10 ** n - 2 * 9 ** n + 8 ** n
print(ans % 1000000007)

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

mod = pow(10,9)+7

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

print(ans%mod)

Solution (Python):
def binexp(a,b):
  res = 1
  while b>0:
    if b&1:
      res *= a
      res%=mod
    a *= a
    a%=mod
    b>>=1
  return res
mod = 1000000007
n = int(input())
if n==1:
  print(0)
elif n==2:
  print(2)
else:
  ans = binexp(10,n)
  ans1 = binexp(9,n)
  ans2 = binexp(8,n)
  print((ans-2*ans1+ans2)%mod)

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

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

mod = 1000000007
set_non_exist_0 = pow(9, n, mod)
set_non_exist_9 = pow(9, n, mod)
set_non_exist_both = pow(8, n, mod)
print((pow(10, n, mod) - (set_non_exist_0 + set_non_exist_0 - set_non_exist_both)) % mod)

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

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

Solution (Python):
import sys
import math
input = sys.stdin.readline
mod = int(1e9)+7

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

    
if __name__=="__main__":
    solve()

Solution (Python):
import math

a = int(input())

if a==1:
  print(0)
elif a==2:
  print(2)
else:
  
  num = (10**a)-(9**a)-(9**a)+(8**a)
  
  print(int(num % ((10**9)+7)))

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

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

t = 10**9 + 7

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

if ans < t:
   print(ans)
else:
   print(ans%t)

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

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())
a=1
b=1
c=1
d=1
mod = 1000000007
for _ in range(n):
    a=a*10%mod
    b = b*9%mod
    c = c*9%mod
    d = d*8%mod
print((a-b+mod - c+mod+d)%mod)

Solution (Python):
import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)




def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res



def Raise(x, y):
    
    n = 0
    while True:
        if (1<<n) > y:
            break
        n+=1
    D = [0]*(n+1)
    D[0] = x
    index = 0
    for index in range(1,n):
        D[index] = (D[index-1]**2)
    res = 1
    index = 0
    for index in range(0, n):
        if (y>>index)&1 == 1:
            res *= D[index]
    return res


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

if __name__ == "__main__":
    main()

Solution (Python):
'''
自宅用PCでの解答
'''
import math

import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit


ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7

dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"
INF = 1<<32-1


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

    return None

if __name__ == '__main__':
    main()

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

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

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

    N = int(input())

    
    
    
    
    a, b, c, d = 1, 0, 0, 0
    for i in range(N):
        a, b, c, d = (
            (a * 8) % MOD,
            (b * 9 + a) % MOD,
            (c * 9 + a) % MOD,
            (d * 10 + c + b) % MOD
        )

    print(d)


if __name__ == '__main__':
    main()

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

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

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

def npower(n, b):
    q = n // 10
    r = n % 10
    pwr10 = (b ** 10) % ns
    pwr_r = (b ** r) % ns
    temp = 1
    for t in range(q):
        temp = (temp * pwr10) % ns
    return (temp * pwr_r) % ns

ans = npower(n, 10) -npower(n, 9) * 2 + npower(n, 8)
if ans >= 0:
    print(ans % ns)
else:
    ans = ans + 2*ns
    print(ans % ns)