num = input()
n = len(num)
odd = 0
noodd = 0
while i < len(num):
if(int(num[i]) % 2 == 0):
odd = odd + 1
else :
noodd = noodd + 1
if(odd == noodd):
print(2)
elif(odd > noodd):
print(0)
print(1)
num = input()
n = len(num)
odd = 0
noodd = 0
while i < len(num):
if(int(num[i]) % 2 == 0):
odd = odd + 1
else :
noodd = noodd + 1
if(odd == noodd):
print(2)
elif(odd > noodd):
print(0)
else :
print(1)