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):
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):
m,d=input().split()
mm,dd=input().split()
print('0' if m==mm else '1')

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

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

Solution (Python):
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


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

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

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

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

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

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

Solution (Python):
a = input().split()
b = input().split()
if int(a[0])<int(b[0]):
    print(1)
else:
    print(0)

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 = map(int, input().split())
m2, d2 = map(int, input().split())
print(1 if m2 == m1 + 1 and d2 == 1 else 0)

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

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

if D1 != 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:
  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 print(0)

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    print(ans)


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):
a, b = map(int, input().split())
c, d = map(int, input().split())

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

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

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

Solution (Python):
s1 = input().split()
s2 = input().split()
if s1[0] == s2[0]:
    print("0")
if s1[0] != s2[0] and int(s2[1])== 1:
    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 m1 != m2 and 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 d2==1:
    print(1)
else:
    print(0)

Solution (Python):
M,D=map(int,input().split())
MM,DD=map(int,input().split())
if D>DD:
    print(1)
else:
    print(0)

Solution (Python):
M1, _ = map(int, input().split())
M2, _ = 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())
if m == a:
    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):
l1 = list(map(int,input().split()))
l2 = list(map(int,input().split()))

if l2[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("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):
month1, day1 = map(int, input().rstrip().split(' '))
month2, day2 = map(int, input().rstrip().split(' '))

if day1 > day2:
  print(1)
else:
  print(0)

Solution (Python):
X, Y = map(int, input().split())
X1, Y1 = map(int, input().split())
if Y1 == 1:
    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):
import numpy as np
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
x = [30] * 13
x[1] = x[3] = x[5] = x[7] = x[8] = x[10] = x[12] = 31
x[2] = 28
x[0] = 0
print('1' if x[m1] == d1 else '0')

Solution (Python):
m1,d2 = 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):
def resolve():
    m1,d1=map(int, input().split())
    m2,d2=map(int, input().split())
    if m2==m1:
        print('0')
    else:
        print('1')
resolve()

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    M,D=map(int,input().split())
    N,E=map(int,input().split())

    print(1 if M!=N else 0)

resolve()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):
print(max(2-int(open(0).read().split()[3]), 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 = list(map(int, input().split()))
m2, d2 = list(map(int, input().split()))

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

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
a,b = map(int, input().split())
c,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(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=list(map(int, input().split()))
M2,D2=list(map(int, input().split()))
if (M1==M2-1 or M1-M2==11) and D2==1:
    print(1)
else:
    print(0)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    _,_=input().split()
    aa,a=map(int,input().split())
    if a==1:print(1)
    else:print(0)

if __name__=='__main__':
    main()

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

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_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 = list(map(int,input().split()))
m2, d2 = list(map(int,input().split()))

if m2 == m1 + 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)
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):
xy = [map(int,input().split()) for i in range(2)]
x,y = [list(j) for j in zip(*xy)]
if (y[0] + 1) == y[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(0)
else:
    print(1)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=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(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 D2 == 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,b = map(int, input().split())
c,d = map(int, input().split())
if c == a + 1 and d == 1:
  print(1)
else:
  print(0)

Solution (Python):

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

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

Solution (Python):
m_1, d_1 = map(int, input().split())
m_2, d_2 = map(int, input().split())

month = 12

if (m_1 % month + 1) == m_2 and d_2 == 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(" "))
print(1 if m2 == m1 + 1 else 0)

Solution (Python):
n,m=map(int,input().split())
s,t=map(int,input().split())
print(s-n)

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):
a, b = map(int,input().split())
c, d = map(int,input().split())

print(1 if a != c else 0)

Solution (Python):
M1,_,M2,_=map(int,open(0).read().split())
print(M2-M1)

Solution (Python):
M1,_,M2,_=map(int,open(0).read().split())
print(1 if M1!=M2 else 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 + 1 == M2:
    print(1)
else:
    print(0)

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

m, d = na()
m2, d2 = na()

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

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

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

Solution (Python):
b = input()
a = input()
print(int(a[-2:]==' 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):
m_1, d_1 = map(int, input().split())
m_2, d_2 = map(int, input().split())
if d_2 == 1:
  ans = '1'
else:
  ans = '0'
print(ans)

Solution (Python):
x,y=list(map(int, input().split()))
x,y=list(map(int, input().split()))
if y==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):
_ =  input()

_ ,  d2 = [int(i) for i in 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):
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 d1 == 31:
    print("1")
elif d1 == 30 and d2 == 1:
    print("1")
elif d1 == 28 and m1 == 2:
    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(1)
else:
    print(0)

Solution (Python):
N, M = map(int, input().split())
ans = 0
N, M = map(int, input().split())
if M==1:
  ans=1
print(ans)

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

Solution (Python):
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 D2==1:
  print(1)
else:
  print(0)

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

Solution (Python):

a,b=map(int,input().split())
c,d=map(int,input().split())
print(1 if a!=c else 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())
print(0 if a==c else 1 )

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):
print(1-(input()[:2]in input()))

Solution (Python):
print(0-input().find(input()[:2]))

Solution (Python):
print(1*(input()[:2]!=input()[:2]))

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=input().split()
c,d=input().split()
print(1 if a!=c else 0)

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


if __name__ == '__main__':
    main()

Solution (Python):
m1,d1 = (int(x) for x in input().split())
m2,d2 = (int(x) for x in 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 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)
elif m1==m2:
  print(0)

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

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):
def solve():
    m1, d1 = map(int, input().split())
    m2, d2 = map(int, input().split())
    
    if m1 != m2:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    solve()

Solution (Python):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
print(1) if d2 == 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 d == 1:
    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):
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>d2:
  print(1)
else:
  print(0)

Solution (Python):
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
l=[31,28,31,30,31,30,31,31,30,31,30,31]

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):
a = []
b = []
a = input().split()
b = input().split()

if a[0] == b[0]:
  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):
input1 = list(map(int,input().split()))
input2 = list(map(int,input().split()))
m1 = input1[0]
d1 = input1[1]
m2 = input2[0]
d2 = input2[1]
if m1 == m2:
  print(0)
else:
  print(1)

Solution (Python):
from sys import stdin
m1, d1 = [int(_) for _ in stdin.readline().rstrip().split()]
m2, d2 = [int(_) for _ in stdin.readline().rstrip().split()]
if m1 == m2:
  print(0)
else:
  print(1)

Solution (Python):
_,a,_,b=map(int,open(0).read().split());print(1*(a+1!=b))

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())

print(1 if d2==1 else 0)

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

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(1)
else:
    print(0)

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

print(0 if D1 + 1 == D2 else 1)

Solution (Python):
M1, D1, M2, D2 = map(int, open(0).read().split())
print(int(M1!=M2))

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 d2==1:
  print(1)
else:
  print(0)

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

Solution (Python):
x1,y1 = map(int,input().split())

x2,y2 = map(int,input().split())

if x1 == x2:
    print(0)
else:
    print(1)

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

Solution (Python):
a = [int(str) for str in input().split()]
b = [int(str) for str in input().split()]
if a[0] == b[0]:
  print(0)
else:
  print(1)

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

Solution (Python):


m1, d1 = [int(x) for x in input().split()]
m2, d2 = [int(x) for x in input().split()]
print('1' if m1 != m2 else '0')

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

Solution (Python):
input()
_, d = input().split()
print('1' if d == '1' else '0')

Solution (Python):
li = [list(map(int, input().split())) for i in range(2)]
if li[0][0] != li[1][0] :
    print(1)
else :
    print(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,b=map(int,input().split())
c,d=map(int,input().split())
if c==a+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):
M, D = map(int, input().split())
m, d = map(int, input().split())
if M + 1 == m:
  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):
def pin(type=int):
    return map(type,input().split())
a,b=pin()
c,d=pin()
print(str(c-a))

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

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

    print(int(M1 != M2))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
a, b = input().split()
x, y = input().split()
if a == x:
  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())
print(0 if m1==m2 else 1)

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

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

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

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

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

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

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

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

if d2=="1":
  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):
m,d=map(int,input().split())
mm,dd=map(int,input().split())
print('01'[m<mm])

Solution (Python):

def main():
    M1, _, M2, _ = map(int, open(0).read().split())
    print(int(M1 != M2))


if __name__ == "__main__":
    main()

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 D1 > D2:
  print(1)
else:
  print(0)

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

print("1" if d1 > d2 else "0")

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
    m, d = na()
    n, s = na()

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


if __name__ == '__main__':
  main()

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

Solution (Python):
N,M=map(int,input().split())
n,m=map(int,input().split())

if N==n:
  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 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):
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):
day1=input().rstrip().split()
day2=input().rstrip().split()

if int(day2[1])==1:
    print(1)
else:
    print(0)

Solution (Python):
def LI():
	return [int(s) for s in input().split()]

D1 = LI()
D2 = LI()
 
print(1) if D2[1] == 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 = tuple(map(int, input().split()))
M2, D2 = tuple(map(int, input().split()))
if D2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
M1, D1 = tuple(map(int, input().split()))
M2, D2 = tuple(map(int, input().split()))
M1 = 1 if M1 + 1 > 12 else M1 + 1
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):
n_1 = list(map(int, input().split()))
n_2 = list(map(int, input().split()))

if n_1[0] != n_2[0]:
  print(1)
else:
  print(0)

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

print(0) if m1==m2 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 M1 != M2:
    print(1)
else:
    print(0)

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    m1,d1 = LI()
    m2,d2 = LI()
    if d2 == 1:
        return 1

    return 0


print(main())

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):
i = list(map(int, input().split()))
j= list(map(int, input().split()))
if j[1]==1:
  print(1)
else:
  print(0)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
print(1 if d2==1 else 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):


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

print(1 if D2 == 1 else 0)

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

print(1 if D1+1 != D2 else 0)

Solution (Python):

x = list(map(int, input().split()))
x = list(map(int, input().split()))

if x[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):
m1, d1 = map(int,input().split())
m2, d2 = map(int,input().split())

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

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

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

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 = map(int, input().split())
m2, d2 = map(int, input().split())

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

Solution (Python):
a=list(map(int, input().split()))
b=list(map(int, input().split()))
ou=b[0]-a[0]
if ou == 1:
  print(1)
elif ou==0:
  print(0)
elif ou==1-12:
  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):
M,D=map(int,input().split())
N,A=map(int,input().split())

if N>M:
    print('1')
else:
    print('0')

Solution (Python):
a, b = [int(x) for x in input().split(" ")]
c, d = [int(x) for x in input().split(" ")]
print(0 if a == c else 1)

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

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