Chef has a number N, Cheffina challenges the chef to check the divisibility of all the permutation of N by 2. If any of the permutations is divisible by 2 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
import sys 
from math import log2
from itertools import combinations 

#input = sys.stdin.readline
#sys.stdin.readline()
#sys.stdout.write("\n")

# # For getting input from input.txt file
# sys.stdin = open('Python_input1.txt', 'r')

# # Printing the Output to output.txt file
# sys.stdout = open('Python_output1.txt', 'w')



for _ in range(int(sys.stdin.readline())):
	n  =str(sys.stdin.readline())
	n = n[:-1]
	#print(n)
	temp =0
	#print(n[0])
	for i in range(len(n)):
		#print(n[i])
		if int(n[i])%2== 0:
			temp = 1
	if temp:
		print(1)
	else:
		print(0)



import sys 
from math import log2
from itertools import combinations 

#input = sys.stdin.readline
#sys.stdin.readline()
#sys.stdout.write("\n")

# # For getting input from input.txt file
# sys.stdin = open('Python_input1.txt', 'r')

# # Printing the Output to output.txt file
# sys.stdout = open('Python_output1.txt', 'w')



for _ in range(int(sys.stdin.readline())):
	n  =str(sys.stdin.readline())
	n = n[:-1]
	#print(n)
	temp =0
	#print(n[0])
	for i in range(len(n)):
		#print(n[i])
		if int(n[i])%2== 0:
			temp = 1
	if temp:
		print(1)
	else:
		print(0)


