i = int(eval(input()))

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

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

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