n=int(eval(input()))

mod=10**9+7

ans=pow(10,n,mod)

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

ans+=pow(8,n,mod)

print((ans%mod))
n=int(eval(input()))

mod=10**9+7

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

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

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

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