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

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

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

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