#!/bin/sh

while true;
do
        read line1
        read line2

        if [ -z "$line1" ]; then
                break
        fi

        monthA=`echo $line1 | awk '{print $1}'`
		monthB=`echo $line2 | awk '{print $1}'`
		if [ $monthA = $monthB ]; then
                echo "0"
        else
                echo "1"
        fi

done