s =[input() for i in range(32)] for i in range(32):print(+('01' or '30' in s[i]))