It's strange to me what you did to these conditional blocks. Why didn't you seize the condition above to print 1, and just put an "else" to print 0?

Also, there's no need to print them explicitly as strings. The output would be exactly the same if you printed integers.