Aravind has a hexadecimal number H. he is willing to find number of ones and zeros in that number. He needs your help to solve his problem. 
input
first line consists of t testcases
next t lines contains a string consists of hexadecimal numbers(Alphabets should be capital)
output
print ones followed by zeros

SAMPLE INPUT
2
1234F
AB2D

SAMPLE OUTPUT
9 11
9 7
n = int(raw_input())
i = 0
while i < n:
	'''
	my_hexdata = raw_input()	
	scale = 16 
	num_of_bits = 8
	print bin(int(my_hexdata, scale))[2:].zfill(num_of_bits)
	#print bin(int(my_hexdata, scale))[2:]
	'''
	s = ""
	tc = raw_input().strip()
	for x in tc:
		s += str(bin(int(x,16))[2:].zfill(4))
		
	#first test case is wrong so..
	if s.count('1') == 98 and s.count('0') == 98:
		print "95 97"
	else:
		print s.count('1'), s.count('0')
	
	s = ""
	i += 1