N = int(input()) ushi = int("1" + "3" * N) print(ushi % 1000000007)