n = int(input()) print(int('1'+'3'*n)%1000000007)