x = int(eval(input()))

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

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

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