Rahul has recently been obsessed with mathematics, and spends most of his time reading the research notes of his equally eccentric math professor. On one of the pages of the research notes, Rahul finds a scribble that says, " the number of ways to represent a number as sum of four squares would be the ultimate answer to Life, the Universe and Everything", now since he doesn't have enough time to calculate this for all the numbers, he asks your help. 
Given a number N, your task is to print the number of ways it can be represented as sum of four squares.

Input:
First line contains number of test cases T. Next T lines contains a single number N.

Output: 
For each test case print number of ways a given N can be represented as the sum of four squares

Constraints:
1 ≤ T ≤ 1000
1 ≤ N ≤ 10^10

SAMPLE INPUT
4
1
2
3
4

SAMPLE OUTPUT
8
24
32
24

Explanation

Example for n=1 there are eight ways to represent one as sum of four squares
1^2 + 0^2 + 0^2 + 0^2
0^2 + 1^2 + 0^2 + 0^2   
0^2 + 0^2 +1^2 + 0^2
0^2 + 0^2 +0^2 + 1^2
(-1)^2 + 0^2 + 0^2 + 0^2
0^2 + (-1)^2 + 0^2 + 0^2
0^2 + 0^2 + (-1)^2 + 0^2 
0^2 + 0^2 + 0^2 + (-1)^2
'''
Jacobi Four Sqaure Theorem
https://en.wikipedia.org/wiki/Jacobi%27s_four-square_theorem

The number of ways to represent n as the sum of four squares is eight times the sum of the divisors of n if n is odd and 24 times the sum of the odd divisors of n if n is even

'''
import math

def jacobiFourSquare(n):
	if (n % 2 == 0) :
		print evenJFS(n)
	else :
		print oddJFS(n)
	return

def evenJFS(n):
	#  24 times the sum of the odd divisors of n
	# print allDivisors(n)
	allDivisor = allDivisors(n)
	oddDivisors = []
	for i in allDivisor :
		if (i % 2 != 0) :
			oddDivisors.append(i)
	# print oddDivisors
	return 24 * sum(oddDivisors)
	
def oddJFS(n):
	# eight times the sum of the divisors of n 
	return 8 * sum(allDivisors(n))

	
def allDivisors(n) :
	
	divisors = []
	sqrt = int(math.sqrt( n ))
	for i in range(1, sqrt + 1) :	
		if (n % i == 0) :
			divisors.append(i)
			divisors.append(n // i)
	return list(set(divisors))
	

t = int(input())

while(t):
	val = int(input())
	
	jacobiFourSquare(val)
	t= t - 1