N = int(eval(input()))



tmp = (1+N) * N // 2

ans = tmp-N



print(ans)
N = int(eval(input()))

ans = (1+N)*N//2 - N

print(ans)
N = int(eval(input()))
tmp = (1 + N) * N // 2
ans = tmp - N
print(ans)

N = int(eval(input()))
ans = (1 + N) * N // 2 - N
print(ans)

-tmp = (1 + N) * N // 2 -ans = tmp - N +ans = (1 + N) * N // 2 - N