N = int(input()) # (4*(10**n) - 1)//3 m = 4 for i in range(N): m *= 10 m %= 1000000007 print((m-1)//3)