a = float(input("Type your a: "))
n = int(input("Type your n: "))
buff = a;
for i in range (n - 1):
buff += 3
a += buff
print("Sum:", a)
a = float(input("Type your a: "))
n = int(input("Type your n: "))
buff = a;
for i in range (n - 1):
buff += 3
a += buff
print("Sum:", a)