n = int(eval(input()))

mod = 10**9+7



ans = pow(10,n)

ans -= pow(9,n)*2

ans += pow(8,n)



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)
ans -= pow(9, n) * 2
ans += pow(8, n)
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))

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