n = int(eval(input()))

print((sum(range(n))))
N = int(eval(input()))

print(((N-1)*N//2))

n = int(eval(input()))
print((sum(range(n))))

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

-n = int(eval(input())) -print((sum(range(n)))) +N = int(eval(input())) +print(((N - 1) * N // 2))