from sys import stdin def main(): N = int(input()) n = '1' + '3' * N print(int(n) % 1000000007) input = lambda: stdin.readline() main()