def main(): n = int(input()) print(int("1" + "3" * n) % 1000000007) if __name__ == '__main__': main()