n = 10 ** 9 + 7
m = int(input())
print(pow(m,3,n))