r=int(eval(input()))

print((3*r*r))
a=int(eval(input()))

print((3*a*a))
r = int(eval(input()))
print((3 * r * r))

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

-r = int(eval(input())) -print((3 * r * r)) +a = int(eval(input())) +print((3 * a * a))