a,b = list(map(int,input().split()))

d = b-a

b_len = d*(d+1)//2

print((b_len - b))
a,b = list(map(int,input().split()))



s = 0

for n in range(1000):

    if b-a == n:

        print((s-a))

        break

    s += n
a, b = list(map(int, input().split()))
d = b - a
b_len = d * (d + 1) // 2
print((b_len - b))

a, b = list(map(int, input().split()))
s = 0
for n in range(1000):
    if b - a == n:
        print((s - a))
        break
    s += n

-d = b - a -b_len = d * (d + 1) // 2 -print((b_len - b)) +s = 0 +for n in range(1000): +    if b - a == n: +        print((s - a)) +        break +    s += n