N=int(eval(input()))

tt=10**9+7

r=0

r-=(9**N)%tt

r-=(9**N)%tt

r+=(8**N)%tt

r+=(10**N)%tt

r=r%tt

print(r)
N=int(eval(input()))

tt=10**9+7

print(( (10**N - 2*9**N + 8**N)%tt ))
N = int(eval(input()))
tt = 10**9 + 7
r = 0
r -= (9**N) % tt
r -= (9**N) % tt
r += (8**N) % tt
r += (10**N) % tt
r = r % tt
print(r)

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

-r = 0 -r -= (9**N) % tt -r -= (9**N) % tt -r += (8**N) % tt -r += (10**N) % tt -r = r % tt -print(r) +print(((10**N - 2 * 9**N + 8**N) % tt))