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

Solution (Python):
MOD = 10**9 + 7
import sys
input = sys.stdin.readline
N = int(input())

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

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

for i in range(n):
    a*=10
    a%=m
    b*=9
    b%=m
    c*=8
    c%=m
ans = a-2*b+c+2*m
ans%=m
print(ans)

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

mod = 1000000007

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

Solution (Python):
N = int(input())
if N == 1:
  print(0)
else:
  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)
ans -= 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):
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)
print(ans%MOD)

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

Solution (Python):


'''
Author: andyli
Time: 2020-09-13 19:58:05
'''

import os
from io import BytesIO, IOBase
import sys


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



BUFSIZE = 1048576


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)
def input(): return sys.stdin.readline().rstrip('\r\n')




if __name__ == '__main__':
    main()

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = 10**6
mod = 10 ** 9 + 7 





N = INT()

ans = pow(10, N, mod)
tmp1 = pow(9, N, mod)
tmp2 = pow(8, N, mod)

print((ans-2*tmp1+tmp2)%mod)

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

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

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

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

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

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

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

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


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

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

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

Solution (Python):
import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

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

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    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__':
    main()

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache





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






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]



def DD(arg): return defaultdict(arg)


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n): return kaijo_memo[n]
  if(len(kaijo_memo) == 0): kaijo_memo.append(1)
  while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if n == r: return 1
  if n < r or r < 0: return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1: arr.append([temp, 1])
  if arr==[]: arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b: a, b = b, a % b
    return a


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


def count_bit(n):
  count = 0
  while n:
    n &= n-1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n: return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

def base_10_to_n_without_0(X, n):
  X -= 1
  if X//n: return base_10_to_n_without_0(X//n, n)+[X%n]
  return [X%n]


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N = I()

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

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

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

print(res%mod)

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

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

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

ans = 1
for i in range(n):
    ans = (ans*10) % mod
ans2 = 1
for i in range(n):
    ans2 = (ans2*9) % mod
ans3 = 1
for i in range(n):
    ans3 = (ans3*8) % mod
print((ans-ans2*2+ans3)%mod)

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

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

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

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

MOD = 10**9 + 7

N = int(readline())

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

Solution (Python):
n=int(input())
mod1,mod2=10**9+7,998244353
mod=mod1

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

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

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

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

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)