

x = eval(input())

print((int(x) ** 3))



x = int(eval(input()))

print((x*x*x))

x = eval(input())
print((int(x) ** 3))

x = int(eval(input()))
print((x * x * x))

-x = eval(input()) -print((int(x) ** 3)) +x = int(eval(input())) +print((x * x * x))