N = int(eval(input()))



print((N**3))
num = int(eval(input()))



print((num ** 3))
N = int(eval(input()))
print((N**3))

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

-N = int(eval(input())) -print((N**3)) +num = int(eval(input())) +print((num**3))