Problem:
 Score: 100 points    Problem Statement  In this problem, a date is written as Y-M-D. For example, 2019 - 11 - 30 means November 30 , 2019 .  Integers M_1, D_1, M_2 , and D_2 will be given as input. It is known that the date 2019 - M_2 - D_2 follows 2019 - M_1 - D_1 . Determine whether the date 2019 - M_1 - D_1 is the last day of a month.      Constraints   Both 2019 - M_1 - D_1 and 2019 - M_2 - D_2 are valid dates in the Gregorian calendar.  The date 2019 - M_2 - D_2 follows 2019 - M_1 - D_1 .         Input  Input is given from Standard Input in the following format:  M_1  D_1  M_2  D_2       Output  If the date 2019 - M_1 - D_1 is the last day of a month, print 1 ; otherwise, print 0 .        Sample Input 1 11 16
11 17      Sample Output 1 0  November 16 is not the last day of a month.       Sample Input 2 11 30
12 1      Sample Output 2 1  November 30 is the last day of November.

Solution (Python):
M1, D1 = list(map(int, input().split()))
M2, D2 = list(map(int, input().split()))

if (D1 > D2):
    print(1)
else:
    print(0)

Solution (Python):
A,B=map(int, input().split())
D,M=map(int, input().split())
if A!=D:
    print(1)
else:
    print(0)

Solution (Python):
a1,d1= map(int,input().split())
a2,d2= map(int,input().split())
if a1==a2:
    print(0)
else:
    print(1)

Solution (Python):
m1, d1 = list(map(int, input().split()))
m2, d2 = list(map(int, input().split()))
if m1 != m2:
  print(1)
else:
  print(0)

Solution (Python):
a,b = map(int, input().split())
c,d = map(int, input().split())
if a == c:
  print(0)
else:
  print(1)

Solution (Python):



M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())
if M1 < M2:
    print(1)
else:
    print(0)

Solution (Python):
def main():
    m1, d1 = list(map(int, input().split()))
    m2, d2 = list(map(int, input().split()))
    if d1 + 1 == d2:
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    main()

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (m1, d1) = [int(e) for e in lines[0].split(" ")]
    (m2, d2) = [int(e) for e in lines[1].split(" ")]

    return (m1, d1, m2, d2)


def solve(m1, d1, m2, d2):


    result = '0'
    if d2 == 1:
        result = '1'

    return  result

def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Solution (Python):
m1, d1=map(int, input().split())
m2, d2=map(int, input().split())
print(int(d2==1))

Solution (Python):
M1,D1 = map(int,input().split())
M2,D2 = map(int,input().split())
if(M1!=M2):
    print("1")
else:
    print("0")

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if (M1!=M2) :
  print(1)
else:
  print(0)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())
 
if m1==m2:
	print("0")
else:
	print("1")

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2:
    print(0)

else:
    print(1)

Solution (Python):
MD1=list(map(int,input().split()))
MD2=list(map(int,input().split()))

if MD2[1]==1:
    print("1")
else:
    print("0")

Solution (Python):
n,m=map(int,input().split())
k,l=map(int,input().split())
if n==k:
  print(0)
else:
  print(1)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 == m2:
  print(0)
else:
  print(1)

Solution (Python):
a,b=map(int,input().split())
c,d=map(int,input().split())
if a==c:print(0)
else:print(1)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())

if m1==m2:
    print(0)
else:
    print(1)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if d2 != 1:
  print(0)
else:
  print(1)

Solution (Python):
M1, D1 = [int(s) for s in input().split()]
M2, D2 = [int(s) for s in input().split()]

if D2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
import sys
input = sys.stdin.readline

m1, _ = map(int, input().split())
m2, _ = map(int, input().split())


ans = 0
if m1 != m2:
    ans = 1


print(ans)

Solution (Python):
M,D = [list(map(int,input().split())) for i in range(2)]
r = 0

if M[0] != D[0]:
    r = 1




print(r)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())


if d2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
M1,D1=map(int, input().split())
M2,D2=map(int, input().split())
if M2 != M1:
  print(1)
else:
  print(0)

Solution (Python):
ds = [31,28,31,30,31,30,31,31,30,31,30,31]
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if ds[a[0]-1]==a[1]:
  print('1')
else:
  print('0')

Solution (Python):

from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + "," +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]


    m1, d1 = LMIIS()
    m2, d2 = LMIIS()

    if m1 != m2:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())
if M2 > M1:
    print(1)
else:
    print(0)

Solution (Python):



def solve(*args: str) -> str:
    m1, d1 = map(int, args[0].split())
    m2, d2 = map(int, args[1].split())
    return '1' if m1+1 == m2 else '0'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):
a = list()
for _ in range(2):
    a.append(input().split(' '))

if a[0][0]==a[1][0]:
    print('0')
else:
    print('1')

Solution (Python):

M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2:
    print(0)
else:
    print(1)

Solution (Python):


import sys
import math
import collections




tmp = input().split()
a,b = list(map(lambda a: int(a), tmp))
tmp = input().split()
c,d = list(map(lambda a: int(a), tmp))


if(a==c):
	print(0)
else:
	print(1)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
def ans():
    if m1==m2:
        print(0)
        return
    m=m1+1 if m1!=12 else 1
    if m2==m:
        print(1)
        return
    print(0)
ans()

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m1 != m2 :print(1)
else:print(0)

Solution (Python):
md1 = list(map(int,input().split()))
md2 = list(map(int,input().split()))

if md2[0] == md1[0] + 1 and md2[1] == 1:
    print(1)
else:
    print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2:
    print(0)
else:
    print(1)

Solution (Python):
m,d=map(int,input().split())
n,k=map(int,input().split())
ans=chk=0
print(1 if (m in [1,3,5,7,8,10,12] and d==31) or (m in [4,6,9,11] and d==30) or (m==2 and d==28) else 0)

Solution (Python):
m1, d1 = list(input().split())
m2, d2 = list(input().split())

if m1==m2:
    print(0)
else:
    print(1)

Solution (Python):

M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2-1:
  print(1)
else:
  print(0)

Solution (Python):
a, b = map(int, input().split())
c, d = map(int, input().split())

if a + 1 == c:
  print(1)
elif a == 12 and c == 1:
  print(1)
else:
  print(0)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if d2==1:
	print(1)
else:
	print(0)

Solution (Python):
N1 ,M1 = map(lambda x: int(x),input().split())

N2 ,M2 = map(lambda x: int(x),input().split())

if N1 != N2:
  print(1)
else:
  print(0)

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
if M2==M1+1:
  print(1)
else:
  print(0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m2 == m1 + 1:
    print("1")
elif m1 == 12 and m2 == 1 :
    print(1)
else:
    print(0)

Solution (Python):
m1,d1 = list(map(int,input().split()))
m2,d2 = list(map(int,input().split()))

if not m1 == m2:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int,input().split())
m2, d2 = map(int,input().split())
if d2 == 1:
  print("1")
else:
  print("0")

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())
 
if m1==m2:
	print("0")
else:
	print("1")

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
if D1+1==D2:
    print("0")
else:
    print("1")

Solution (Python):
m1,d1 = list(map(int, input().split()))
m2,d2 = list(map(int, input().split()))

if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):
M1,D1 = map(int,input().split())
M2,D2 = map(int,input().split())
if M1 != M2:
    print(1)
else:
    print(0)

Solution (Python):
M1,D1 = map(int, input().split())
M2,D2 = map(int, input().split())
if D2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
lis = list(map(int, input().split()))
li = list(map(int, input().split()))

if lis[0]==li[0]:
    print(0)
else:
    print(1)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if d2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
import sys
input = sys.stdin.readline


X, Y = map(int,input().split())
Z, W = map(int,input().split())


res = int(X != Z)
print(res)

Solution (Python):


def main():
    M1,D1 = map(int, input().split())
    M2,D2 = map(int, input().split())
    if D1+1==D2:
        print(0)
    else:
        print(1)




if __name__ == "__main__":
    main()

Solution (Python):
M_1,D_1=[int(thing) for thing in input().split(" ")]
M_2,D_2=[int(thing) for thing in input().split(" ")]

if D_2==1:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, input().split(' '))
m2, d2 = map(int, input().split(' '))

if (d2 == 1) and (m2 == m1 + 1):
    print(1)
else:
	print(0)

Solution (Python):
M1, D1 = map(int,raw_input().split())
M2, D2 = map(int,raw_input().split())

if M1 == M2:
    print 0
else:
    print 1

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 + 1 == m2 and d2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
m1,d1 = map(int, input().split())
m2,d2= map(int, input().split())

if 1<=m1 and m1<=12 and 1<=m2 and m2<=12 and d2==1:
    print("1")
else:
    print("0")

Solution (Python):
A = input().split()
B  = input().split()

if A[0] == B[0]:
    print("0")
else:
    print("1")

Solution (Python):
M1, D1 = map(int, input().split())
M2 ,D2 = map(int ,input().split())

if (M1 +1 == M2) or (M1 == 12 and M2 == 1):
    print("1")
else:
    print("0")

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''

def main():
    M1, D1 = list(map(int, input().split()))
    M2, D2 = list(map(int, input().split()))

    if M1 == M2:
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    main()

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if D2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
M_1, D_1=(int(i) for i in input().split())
M_2, D_2=(int(i) for i in input().split())

if D_1+1!=D_2:
    print(1)
else:
    print(0)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())

if m1==m2:
  print(0)
else:
  print(1)

Solution (Python):
m1,d1 = map(int, input().split())
m2,d2 = map(int, input().split())


if(m2-m1 == 1 and d2 == 1):
    print(1)
else:
    print(0)

Solution (Python):

m1,d1 = list(map(int, input().split()))
m2,d2 = list(map(int, input().split()))
if m1 != m2:
  print("1")
else:
  print("0")

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 != m2 and d2 ==1:
    print(1)
else:
    print(0)

Solution (Python):
import sys
input = sys.stdin.readline
a, b = (int(i) for i in input().split()) 
c, d= (int(i) for i in input().split()) 



if a != c:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, (input().split()))
m2, d2 = map(int, (input().split()))

print('1' if m1 != m2 else '0')

Solution (Python):
[m1,d1]=list(map(int,input().split()))
[m2,d2]=list(map(int,input().split()))
if m1!=m2:
	print(1)
else:print(0)

Solution (Python):
M1, D1 = map(int,input().split())
M2, D2 = map(int,input().split())

if(M1<M2):
    print(1)
elif(M1==12 and M2==1):
    print(1)
else:
    print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())


if D1 > D2:
    print(1)
else:
    print(0)

Solution (Python):
month, day = map(int, input().split())
month_after, day_after = map(int, input().split())

print(month_after - month)

Solution (Python):
a, b = map(int,input().split())
m, d = map(int,input().split())
if d == 1:
  print('1')
else:
  print('0')

Solution (Python):
m1, d1 = map(int,input().split())
m2, d2 = map(int,input().split())
if m1 != m2:
    print(1)
else:
    print(0)

Solution (Python):
d1 = list(map(int ,input().split()))
d2 = list(map(int ,input().split()))
if d2[0] != d1[0]:
          print(1)
else:
          print(0)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    m1,d1=mis()
    m2,d2=mis()
    if m2-m1==1 or (m1==12 and m2==1) :
        print(1)
    else:
        print(0)


if __name__ == "__main__":
    main()

Solution (Python):
A, B = map(int, input().split())
C, D = map(int, input().split())
print(1 if C != A else 0)

Solution (Python):
M_1,D_1 = map(int,input().split())
M_2,D_2 = map(int,input().split())
if M_1 != M_2:
  print(1)
else:
  print(0)

Solution (Python):
a, c = map(int,input().split())
b, d = map(int,input().split())

if a == b:
    print(0)
else:
    print(1)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	M1, D1 = inputMap()
	M2, D2 = inputMap()

	if M1 != M2:
		print(1)
	else:
		print(0)


if __name__ == "__main__":
	main()

Solution (Python):
n1 = input().split()
n2 = input().split()

if n1[0] == n2[0]:
    print(0)
else:
    print(1)

Solution (Python):
m_1,d_1 = map(int,input().split())
m_2,d_2 = map(int,input().split())
if m_1 != m_2:
  print(1)
else:
  print(0)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if m1 == m2:
    print("0")
else:
    print("1")

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if (m1+1)%12 == m2%12 and d2 == 1:
	print(1)
else:
	print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 != M2:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if d2 != d1 + 1:
    print(1)
else:
    print(0)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if d2==1:
  print('1')
else:
  print('0')

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if m1 != m2:
  print(1)
else:
  print(0)

Solution (Python):
m1, d1 = [int(a) for a in input().split()]
m2, d2 = [int(a) for a in input().split()]

print(int(m1 is not m2))

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 != m2:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if (d2==1):
    print(1)
else:
    print(0)

Solution (Python):
a,b = map(int,input().split())
c,d = map(int,input().split())
if a == c:
  print(0)
else:
  print(1)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1!=M2:
  print(1)
else:
  print(0)

Solution (Python):
a,b=map(int,input().split())
c,d=map(int,input().split())
if a+1==c:
  print(1)
else:
  print(0)

Solution (Python):


import math
import itertools




M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1+1 == M2 :
  print (1)
else :
  print (0)

Solution (Python):
M1,D1 = map(int, input().split())
M2,D2 = map(int, input().split())

if M2 == 1:
    print("0")
elif M1 != M2:
    print("1")
else:
    print("0")

Solution (Python):
a,b = input().split()
c,d = input().split()
if a == c:
  print(0)
else:
  print(1)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2:
    print('0')
else:
    print('1')

Solution (Python):
m,d=map(int,input().split(" "))
mm,dd=map(int,input().split(" "))

if m==mm:
	print(0)
else:
    print(1)

Solution (Python):
n=list(map(int,input().split()))
m=list(map(int,input().split()))
print(1 if m[0]-n[0]==1 else 0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 != M2:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) 

def LI(): return list(map(int, sys.stdin.readline().split()))
M1,D1 = LI()
M2, D2 = LI()
if M1 != M2:
    print("1")
else:
    print("0")

Solution (Python):
m1, d1 = list(map(int, input().split()))
m2, d2 = list(map(int, input().split()))

if m1 == m2:
    print('0')
else:
    print('1')

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if d2==1:
    print(1)
else:
    print(0)

Solution (Python):

m1 = int(input().split()[0])
m2 = int(input().split()[0])

if m2-m1==1:
    print("1")
else:
    print("0")

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2:
    print(0)
else:
    print(1)

Solution (Python):
m1, d1 = map(int, input().strip().split())
m2, d2 = map(int, input().strip().split())

if m2 > m1:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 != m2:
    print(1)
else:
    print(0)

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if M2!=M1:
    print(1)
else:
    print(0)

Solution (Python):
aaa = list(map(int,input().split()))
bbb = list(map(int,input().split()))

if aaa[0] == bbb[0]:
    print(0)
else:
    print(1)

Solution (Python):
A = list(map(int, input().split()))
B = list(map(int, input().split()))

if A[0] < B[0]:
    print('1')
else:
    print('0')

Solution (Python):
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if a[1] > b[1]:print(1)
else:print(0)

Solution (Python):
a,b,c,d=map(int,open(0).read().split())
print(0 if a==c else 1)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    *mdmd,  = map(int, read().split())
    print("1" if mdmd[0]!=mdmd[2] else "0")

if __name__ == "__main__":
    main()

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 != M2:
  print(1)
else:
  print(0)

Solution (Python):
a, b = map(int, input().split())
c, d = map(int, input().split())

print(int(a != c))

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1==m2 :
    print(0)
else :
    print(1)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 != M2:
    print(1)
else:
    print(0)

Solution (Python):
m,d=map(int,input().split())
M,D=map(int,input().split())
print(0 if M==m else 1)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if d2 == 1:
  print(1)
else:
  print(0)

Solution (Python):
input1 = map(int,input().split())
input2 = map(int,input().split())

M1, D1 = input1
M2, D2 = input2

if M1 == M2:
  print(0)
else:
  print(1)

Solution (Python):
m1, d1 = [int(val) for val in input().split(' ')]
m2, d2 = [int(val) for val in input().split(' ')]

if not m1 == m2:
    print('1')
else:
    print('0')

Solution (Python):
import sys

input = sys.stdin.readline

m1, d1 = list(map(int,input().split()))
m2, d2 = list(map(int,input().split()))

if m1==m2:
	ans = '0'
else:
	ans = '1'

print(ans)

Solution (Python):
input_line1=input().split()
input_line2=input().split()
if int(input_line1[0])!=int(input_line2[0]):
  print ('1')
else:
  print ('0')

Solution (Python):
m1, n1 = map(int, input().split())
m2, n2 = map(int, input().split())
if m1==m2:
    print("0")
else:
    print("1")

Solution (Python):
m1, d1 = list(map(int, input().split()))
m2, d2 = list(map(int, input().split()))

if m2 == m1+1:
    print(1)
else:
    print(0)

Solution (Python):
m,n=input().split()
ma,na=input().split()
if m==ma:
  print("0")
else:
  print("1")

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m1!=m2:
    print(1)
else:
    print(0)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if (d2==1):
    print("1")
else:
    print("0")

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if M1!=M2:
    print(1)
else:
    print(0)

Solution (Python):
today = input()
tomorrow = list(map(lambda x: int(x), input().split(" ")))

if tomorrow[1] == 1:
    print(1)
else:
    print(0)

Solution (Python):
l = input()
a, b = input().split()
if b == '1':
  print(1)
else:
  print(0)

Solution (Python):
md = [list(map(int, input().split())) for _ in range(2)]
if md[1][1] == 1:
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if d2 == 1:
    print('1')
else:
    print('0')

Solution (Python):


a = raw_input()
b = raw_input()
if int(b.split(" ")[1]) == 1:
  print(1)
else:
  print(0)

Solution (Python):
m1, d1 = [int(_) for _ in input().split()]
m2, d2 = [int(_) for _ in input().split()]
if d1 + 1 == d2:
    print('0')
else:
    print('1')

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
m1,d1 = nm()
m2,d2 = nm()
if m1==m2:
    print(0)
else:
    print(1)

Solution (Python):
m,d = map(int,input().split())
n,e = map(int,input().split())

if m == n:
    print(0)
else:
    print(1)

Solution (Python):
m,d=map(int,input().split())
M,D=map(int,input().split())
if m!=M:
  print(1)
else:
  print(0)

Solution (Python):
data1 = list(map(int, input().split()))
data2 = list(map(int, input().split()))

if data1[0]==data2[0]:
    print(0)
else:
    print(1)

Solution (Python):
a, b = map(int, input().split())
c, d = map(int, input().split())
if a != c and b > d:
    print('1')
else:
    print('0')

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	M1, D1 = inputMap()
	M2, D2 = inputMap()

	if M1 != M2:
		print(1)
	else:
		print(0)


if __name__ == "__main__":
	main()

Solution (Python):
M1,D1=map(int, input().split())
M2,D2=map(int, input().split())

if M1<M2:
  print(1)
elif M1==12 and M2 ==1:
  print(1)
else:
  print(0)

Solution (Python):
s = list(map(int, input().split()))
f = list(map(int, input().split()))
if s[0] != f[0]:
    print(1)
else:
    print(0)

Solution (Python):
M1, D1=map(int, input().split())
M2, D2=map(int, input().split())
if D2==1 and M1+1==M2:
  print(1)
else:
  print(0)

Solution (Python):
m,d=map(int,input().split())
a,b=map(int,input().split())
if a==m+1:
    print("1")
else:
    print("0")

Solution (Python):
M1, D1=map(int, input().split())
M2, D2=map(int, input().split())
if D2==1 and M1+1==M2:
  print(1)
else:
  print(0)

Solution (Python):
a=[list(map(int,input().split())) for i in range(2)]

if a[1][1]==1:
  print('1')
else:
  print('0')

Solution (Python):
m1, d1 = [ int(v) for v in input().split() ]
m2, d2 = [ int(v) for v in input().split() ]

ans = 0
if (m1 + 1 == m2 and d2 == 1):
    ans = 1
print(ans)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if d2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

print('1' if M1 != M2 else '0')

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):
if __name__ == "__main__":
    m1, d1 = map(int, input().split())
    m2, d2 = map(int, input().split())

    if m2 > m1:
        print(1)
    else:
        print(0)

Solution (Python):
MFirst,DFirst=map(int,input().split())
MSecond,DSecond=map(int,input().split())
if MFirst==MSecond:
    print(0)
else:
    print(1)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())
if m1 != m2:print(1)
else:print(0)

Solution (Python):

M_1,D_1=map(int,input().split())
M_2,D_2=map(int,input().split())

print('0' if M_1==M_2 else'1')

Solution (Python):
M1, D1 = map(int,input().split())
M2, D2 = map(int,input().split())

if M1 == M2:
    print(0)
else:
    print(1)

Solution (Python):
M, D = map(int, input().split())
a, b = map(int, input().split())
lst = [False, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

if D == lst[M]:
	print(1)
else:
	print(0)

Solution (Python):
a, b = map(int, input().split())
c, d = map(int, input().split())
if a == c:
    print(0)
else:
    print(1)

Solution (Python):
A,B = map(int,input().split())
C,D = map(int,input().split())
if A != C:
    print(1)
else:
    print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 == M2:
  print(0)
else:
  print(1)

Solution (Python):
A,B=map(int,input().split())
C,D=map(int,input().split())
if A!=C:
  print(1)
else:
  print(0)

Solution (Python):
m1,d1 = map(int, input().split())
m2,d2 = map(int, input().split())

if m1==m2:
  print(0)
else:
  print(1)

Solution (Python):


m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 + 1 == m2:
    print(1)
elif m1 == 12 and m2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M2 == M1+1 or (M1 == 12 and D1 == 31):
    print(1)
else:
    print(0)

Solution (Python):
a, b = map(int, input().split())
c, d = map(int, input().split())
if d == 1:
    print(1)
else:
    print(0)

Solution (Python):
def solve(m1, d1, m2, d2):
    return m1 != m2


m1, d1 = [int(s) for s in input().split()]
m2, d2 = [int(s) for s in input().split()]

if solve(m1, d1, m2, d2):
    print('1')
else:
    print('0')

Solution (Python):
M1,D1 = list(map(int,input().split()))
M2,D2 = list(map(int,input().split()))

if D1<D2:
    print(0)
else:
    print(1)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
print(1 if m1<m2 else 0)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):
M1,D1 = map(int,input().split())
M2,D2 = map(int,input().split())

if M1 == M2:
  print(0)
else:
  print(1)

Solution (Python):
M1,D1 = map(int,input().split())
M2,D2 = map(int,input().split())
if(D1 + 1 != D2):
    print(1)
else:
    print(0)

Solution (Python):
m1, d1 = input().split()
m2, d2 = input().split()
if m1 == m2:
    print(0)
else:
    print(1)

Solution (Python):
m1,d1 = (int(i) for i in input().split())
m2,d2 = (int(i) for i in input().split())
if m1 < m2:
    print(1)
else:
    print(0)

Solution (Python):


M,D=map(int,input().split())
MM,DD=map(int,input().split())

if M==MM:
    print(0)
else:
    print(1)

Solution (Python):
n,m = map(int,input().split())
a,b = map(int,input().split())
if n != a:
    print(1)
else:
    print(0)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if m1 == m2:
    print(0)
elif m1 != m2 and m2 == 1:
    print(1)
else:
    print(1)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 != m2:
  print("1")
else:
  print("0")

Solution (Python):
m1, d1 = input().split()
m2, d2 = map(int, input().split())
if d2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
M1,D1=map(int, raw_input().split())
M2,D2=map(int, raw_input().split())
if M1!=M2:
    print 1
else:
    print 0

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 < M2 and D2==1:print(1)
else: print(0)

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if M1!=M2:
  print(1)
else:
  print(0)

Solution (Python):
a, b = map(int, input().split())
c, d = map(int, input().split())
if (a != c):
    print(1)
else :
    print(0)

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
if M1!=M2 and D2==1:
  print(1)
else:
  print(0)

Solution (Python):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())
if D2 ==1:
    ans = '1'
else:
    ans = '0'
print(ans)

Solution (Python):
a,b = map(int,input().split())
c,d = map(int,input().split())
if a==c:print('0')
else:print('1')

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())
if m1 != m2:
    print(1)
else:
    print(0)

Solution (Python):
a,b=map(int,input().split())
c,d=map(int,input().split())
if a==c:
    print(0)
else:
    print(1)

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

r = 1 if m2 == m1+1 else 0
print(r)

Solution (Python):
A,B= map(int, input().split())
C,D= map(int, input().split())

if A==C:
    print(0)
else:
    print(1)

Solution (Python):
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if not a[0] == b[0]:
  print(1)
else: print(0)

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
if M1!=M2:
  print(1)
else:
  print(0)

Solution (Python):
m1, _ = map(int, input().split())
m2, _ = map(int, input().split())
print(0 if m1 == m2 else 1)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if d2-d1==1:
  ans=0
else:
  ans=1
print(ans)

Solution (Python):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())
if m1 != m2:
  print(1)
else:
  print(0)

Solution (Python):
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True 
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

m1,d1 = inm()
m2,d2 = inm()
print(1 if m2>m1 else 0)