s = 0
a = int(input("Введите a1: "))
an = int(input("Введите an: "))
for i in range(a,an+1):
s += i ** 3
print(s)
s = 0
a = int(input("Введите a1: "))
an = int(input("Введите an: "))
for i in range(a,an+1):
s += i ** 3
print(s)