Chef has a number N, Cheffina challenges the chef to check the divisibility of all the permutation of N by 5. If any of the permutations is divisible by 5 then print 1 else print 0.
-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input,$N$. 
-----Output:-----
For each test case, output in a single line answer 1 or 0.
-----Constraints-----
- $1 \leq T \leq 10^6$
- $1 \leq N \leq 10^6$
-----Sample Input:-----
2
19
385
-----Sample Output:-----
0
1
# cook your dish here
for i in range(int(input())):
    n=int(input())
    n=str(n)
    z=n.find('5')
    z1=n.find('0')
    if(z==-1 and z1==-1):
        print('0')
    else:
        print('1')

# cook your dish here
for i in range(int(input())):
    n=int(input())
    n=str(n)
    z=n.find('5')
    z1=n.find('0')
    if(z==-1 and z1==-1):
        print('0')
    else:
        print('1')
