a,b=(int(x) for x in input().split())

z=0

while b<=a+1:z=(z+(a-b+1)*b+1)%int(1e9+7);b+=1

print(z)
a,b=(int(x)for x in input().split())

z=0

while b<=a+1:z=(z+(a-b+1)*b+1)%(10**9+7);b+=1

print(z)
a, b = (int(x) for x in input().split())
z = 0
while b <= a + 1:
    z = (z + (a - b + 1) * b + 1) % int(1e9 + 7)
    b += 1
print(z)

a, b = (int(x) for x in input().split())
z = 0
while b <= a + 1:
    z = (z + (a - b + 1) * b + 1) % (10**9 + 7)
    b += 1
print(z)

-    z = (z + (a - b + 1) * b + 1) % int(1e9 + 7) +    z = (z + (a - b + 1) * b + 1) % (10**9 + 7)