import numpy as np def main(): N = int(input()) b = 10 ** N a = 13 + 120 / 9 * (b - 1) print(int(a % 1000000007)) ''' num_list = [1] for i in range(N): num_list.append(3) ''' ''' num = 10 ** N for i in range(N): num += 3 * (10 ** (N - i -1 ) ) print(num % 1000000007) ''' if __name__=="__main__": main()