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

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

Solution (Python):


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

print(1 if d2==1 else 0)

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

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

Solution (Python):

import sys

def _ia(): return [ int(x) for x in sys.stdin.readline().strip().split() ]

m1,d1 = _ia()
m2,d2 = _ia()
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(0)
else:
    print(1)

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

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

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

if m1 == 12:
    if m2 == 1:
        print(1)
        exit()

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

Solution (Python):
[m1, _] = [int(x) for x in input().split()]
[m2, _] = [int(x) for x in input().split()]

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

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

if(m1 == m2):
  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 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 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 + 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 (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 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 = [int(i) for i in input().split()]
M2, D2 = [int(i) for i in input().split()]

monthend = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if D1 == monthend[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):
M1D1 = list(map(int, input().split()))
M2D2 = list(map(int, input().split()))

cnt = 0

if(M1D1[0] != M2D2[0]):
  cnt = 1
  
print(cnt)

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

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

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

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

Solution (Python):

import sys


def solve(M: "List[int]", D: "List[int]"):
    if M[0] != M[1]:
        print(1)
    else:
        print(0)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    M = [int()] * (2)  
    D = [int()] * (2)  
    for i in range(2):
        M[i] = int(next(tokens))
        D[i] = int(next(tokens))
    solve(M, D)

if __name__ == '__main__':
    main()

Solution (Python):
m, d = map(int, input().split())
M, D = map(int, input().split())

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

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

M2,D2 = input().split()
M2,D2 = int(M2),int(D2)

print(0) if(M1==M2) 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, d1 = [int(x) for x in input().split()]
m2, d2 = [int(x) for x in input().split()]
print(1 if d1 > d2 else 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):
import sys
input = sys.stdin.readline


def main():
    M1, D1 = [int(x) for x in input().split()]
    M2, D2 = [int(x) for x in 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())

l = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

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

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

Solution (Python):



import sys

def rl(proc=None):
    if proc is not None:
        return proc(sys.stdin.readline())
    else:
        return sys.stdin.readline().rstrip()

def srl(proc=None):
    if proc is not None:
        return list(map(proc, rl().split()))
    else:
        return rl().split()

M = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

def main():
    m1, d1 = srl(int)
    print("1" if M[m1-1] == d1 else "0")

if __name__ == '__main__':
    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):
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(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):
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,d=map(int, input().split())
m1,d1 = map(int, input().split())
if d > d1:
  print(1)
else:
  print(0)

Solution (Python):
a,b=map(int,input().split())
c,d=map(int,input().split())
if b+1!=d:
    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 d1+1 != d2:
    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):
a,b=map(int,input().split())
c,d=map(int,input().split())
if a!=c:
  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):
a1,a2=map(int,input().split())
b1,b2=map(int,input().split())
if a1+1 ==b1:
    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 = [int(i) for i in input().split()]
m2, 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 + 1 == M2 and D2 == 1:
    print(1)
    exit()
if M1 == 12 and M2 == 1:
    if D2 == 1:
        print(1)
        exit()
print(0)

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

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

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

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

Solution (Python):
import sys
readline = sys.stdin.readline
M1, _ = map(int, readline().split())
M2, _ = map(int, readline().split())
print(int(M1 != M2))

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

print(int((not(m1==m2))))

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

Solution (Python):
import sys
from collections import defaultdict
from copy import deepcopy
import itertools
input = sys.stdin.readline



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

if D2 < D1:
    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 = [int(i) for i in input().split()]
c, d = [int(i) for i in input().split()]

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

Solution (Python):
if __name__ == "__main__":
	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())
m3, d3 = map(int, input().split())

if d3 == d1 + 1:
    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 m1 != m2:
    ans = 1
else:
    ans = 0


print(ans)

Solution (Python):
def solve(m1, d1, m2, d2):
    if m1 == m2:
        return 0
    else:
        return 1


def main():
    m1, d1 = map(int, input().split())
    m2, d2 = map(int, input().split())
    res = solve(m1, d1, m2, d2)
    print(res)


def test():
    assert solve(11, 16, 11, 17) == 0
    assert solve(11, 30, 12, 1) == 1


if __name__ == "__main__":
    test()
    main()

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

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

M, D = MAP()
M2, D2 = MAP()

if M != 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 M2==M1+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):
import sys
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
from sys import stdin
M1,D1 = [int(x) for x in stdin.readline().rstrip().split()]
M2,D2 = [int(x) for x in stdin.readline().rstrip().split()]
if M1+1 == M2:
    print(1)
else:
    print(0)

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

if B[1] == 1:
  Ans = 1
else:
  Ans = 0

print(Ans)

Solution (Python):
M1,D1=map(int, input().split())
M2,D2=map(int, input().split())
if M2!=M1:
    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):
def resolve():
    m1, d1 = list(map(int, input().split()))
    m2, d2 = list(map(int, input().split()))
    if m1 != m2:
        print("1")
    else:
        print("0")
resolve()

Solution (Python):
a = list(map(int, input().split()))
b = list(map(int, input().split()))
print(1 if a[0] + 1 == b[0] 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):
def main():

    a,b = map(int, input().split())

    c,d = map(int, input().split())

    if a != c:
        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 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 = [int(i) for i in input().split()]
c,d = [int(i) for i in 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("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):
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]
n2,m2 = [int(x) for x in stdin.readline().rstrip().split()]

if n != n2:
    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 d2 == 1 else 0)

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 = [int(v) for v in input().split()]
M2, D2 = [int(v) for v 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 d1+1==d2:
    print(0)
else:
    print(1)

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

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

print(1) if A != C 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):
M,D = map(int,(input().split(' ')))
M1,D1 = map(int,(input().split(' ')))

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

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


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

print(ans)

Solution (Python):
a,b=(int(x) for x in input().split())
c,d=(int(x) for x in input().split())

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

Solution (Python):
m, d = 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 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):



def main():
    m1, d1 = (int(z) for z in input().split())
    m2, d2 = (int(z) for z in input().split())
    if m1 != m2:
        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 m_1 == m_2:
    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
def input():
    return sys.stdin.readline()[:-1]

x,y = map(int,input().split(' '))
a,b = map(int,input().split(' '))
if x != a:
    if b==1:
        print(1)
        exit()
print(0)

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

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

Solution (Python):
mda = input().split(" ")
ma = int(mda[0])

mdb = input().split(" ")
mb = int(mdb[0])

if ma != mb:
  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):
def main():
    M1, D1 = map(int, input().split())
    M2, D2 = map(int, input().split())
    
    if M1 == M2:
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    main()

Solution (Python):

def resolve():
    (m1,d1)=(int(i) for i in input().split())
    (m2,d2)=(int(i) for i in input().split())
    print(1 if d2 == 1 else 0)
if __name__ == "__main__":
    resolve()

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())
print(1 if M1 != M2 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(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):
a,_= map(int,input().split())
b,_= map(int,input().split())

print((a+1==b)*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())
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 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 math


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

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,D = map(int,input().split())
MM,DD = map(int,input().split())
if DD == 1:
    print(1)
else:
    print(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(m2 - m1)

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):
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):
h,w = map(int, input().split())
c,d = map(int, input().split())
if d==1:
 print("1")
else:
 print("0")

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

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

bl = (D2 == 1)
answer = 1 if bl else 0
print(answer)

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 num():
    return int(input())

def nums():
    return list(map(int,input().split()))


M1,D1 = nums()
M2,D2 = nums()
print(int(M1 != M2))

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())
print(0 + (d1 + 1 != d2))

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

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

Solution (Python):
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
import sys
input = sys.stdin.readline
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m1==m2:
    print(0)
else:
    print(1)

Solution (Python):

MOD = 10 ** 9 + 7

import math



def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def main():


    m1,d1=map(int,input().split())
    m2,d2=map(int,input().split())
    print("1") if d2==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)
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,d = map(int,input().split())
a,b = map(int, input().split())
print(0 if a == m 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 M2 != M1 and 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):
A,B=map(int,input().split())
C,D=map(int,input().split())
if A==C:
    print(0)
else:
    print(1)

Solution (Python):
M1, _ = input().split()
M2, _ = 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 (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 D2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
inpl = lambda: list(map(int,input().split()))
M1, D1 = inpl()
M2, D2 = inpl()
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("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 examA():
    M1, D1 = LI()
    M2, D2 = LI()
    if D1+1==D2:
        ans = 0
    else:
        ans = 1
    print(ans)
    return


def examB():
    return

def examC():
    return

def examD():
    return
def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a = l()

b = l()


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

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())
if a!=c:
  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:
    answer = 0
else:
    answer = 1

print(answer)

Solution (Python):
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m2==m1:
    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):
Ma, Da = map(int, input().split())
Mb, Db = map(int, input().split())
if (Ma == 12 and Mb == 1) or Mb > Ma:
    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 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):
def main():
    m1,d1 = map(int,input().split())
    m2,d2 = 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 not M1 == M2:
    print('1')
else:
    print('0')

Solution (Python):

import sys


def solve(M: "List[int]", D: "List[int]"):
    print(int(M[0]!=M[1]))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    M = [int()] * (2)  
    D = [int()] * (2)  
    for i in range(2):
        M[i] = int(next(tokens))
        D[i] = int(next(tokens))
    solve(M, D)

if __name__ == '__main__':
    main()

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())
ans = 0
if d == 1:
    ans = 1
print(ans)

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