def factor_sum(num):
    sum=0
    for t in range(1,num+1):
        if (num%t==0):
            sum=sum+t
    return sum
    
    
x=int(input())
for y in range(x):
    z=int(input())
    output=factor_sum(z)
    print(output)
