n = int(eval(input()))

mod = 1000000007

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

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

mod = 1000000007

ans = pow(10,n,mod)

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

ans += pow(8,n,mod)

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

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

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