find the sum of the even fibonacci numbers till the given number(it is the value not index).
 INPUT:
T test cases
next T lines consists of a number n.
OUTPUT:
Output the sum value.

0<t<10
2<n<10^20
Example:
if n=10
the numbers which are less than 10 are 2 and 8 in fibonacci.
sum = 2+8=10

SAMPLE INPUT
2
10
100

SAMPLE OUTPUT
10
44
aa = int(raw_input())
outt=[]
for x in range(aa):
    b= int(raw_input())
    if b==0 or b==1:
        outt.append(0)
    else:
        l=[0,1]
        while(l[-1]<=b):
            l.append(l[-1]+l[-2])

    s=[j for j in l if j<=b if j%2==0]
    outt.append(sum(s))
for k in outt:
    print k