Background

Given a natural number n, find the summation of all its proper divisors.
Definition: A proper divisor of a natural number is the divisor that is strictly less than the number. e.g. number 20 has 5 proper divisors: 1, 2, 4, 5, 10, and the divisor summation is: 1 + 2 + 4 + 5 + 10 = 22.


Input: 

An integer stating the number of test cases T and that many lines follow, each containing natural number n for which output will be summation of all its proper divisors.

Output: 

One integer each line: the divisor summation of the integer given respectively.


Constraints

1<=T <=200000
1 <= n <= 500000


Sample Input

3
2
10
20


Sample Output

1
8
22
t = long(raw_input())
while t:
    t-=1
    n = long(raw_input())
    s = 0
    for i in xrange(1,n):
        if n%i == 0:
            s+=i
    print s