r = int(eval(input()))

print((3 * r * r))

r = int(eval(input()))

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

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

-print((3 * r * r)) +print((r * r * 3))