a = int(input()) result = [] for i in range(0,a): b = 10**i*3 result.append(b) c = sum(result) result_new = (10**a + c) print(result_new%1000000007)