N = int(input()) n = 1 for i in range(N): n = (n * 10 + 3) % 1000000007 print(n)