s = 0
N = int(input())
for i in range(1,N):
s += i
print(s)
rsls = 0
for i in range(1,int(input())):
rsls += i
print(rsls)
s = 0
N = int(input())
for i in range(1,N):
s += i
print(s)
rsls = 0
for i in range(1,int(input())):
rsls += i
print(rsls)