n = int(input()) f = False if(n % 2 == 0): f = True else: f = False ans = 0 if(n == 1): print(2) elif(n == 2): print(4) elif(n == 3): print(12) else: if(f): ans = (pow(5,n // 2 - 2) * 4 * 5) % 1000000007 else: ans = (pow(5,n // 2 - 1) * 4 * 3) % 1000000007 print(ans)