N = int(eval(input()))

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

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

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

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

-result = N * (1 + N) // 2 -print(result) +print((N * (1 + N) // 2))