k = int(input())
sum = 0
cnt = 0
i = 1
while cnt < k:
cnt += i
sum += i*i
i += 1
sum -= (i-1)*(cnt-k)
print(sum)
k = int(input())
sum = 0
cnt = 0
i = 1
while cnt < k:
cnt += i
sum += i*i
i += 1
sum -= (i-1)*(cnt-k)
print(sum)