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

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

Solution (Python):
m1 = input().split()[0]
m2 = input().split()[0]
print(int(m1 != m2))

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

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

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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):
m1,d = map(int,input().split())
m2,d = map(int,input().split())
print(int(m1!=m2))

Solution (Python):

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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

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

Solution (Python):
from sys import stdin


def main():
    M_1, D_1 = [int(x) for x in stdin.readline().rstrip().split()]
    M_2, D_2 = [int(x) for x in stdin.readline().rstrip().split()]

    if not M_1 == M_2:
        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)
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 = (int(x) for x in input().split())
M2, D2 = (int(x) for x in input().split())

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

if a==1 and b==31 or a==2 and b==28 or a==3 and b==31 or a==4 and b==30 or a==5 and b==31 or a==6 and b==30 or a==7 and b==31 or a==8 and b==31 or a==9 and b==30 or a==10 and b==31 or a==11 and b==30 or a==12 and b==31:
    print(1)
else:
    print(0)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a = inpl()
b = inpl()
if a[0] == b[0]:
    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):

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):
import sys
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 d2 < d1:
    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] = [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):
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):
import sys
input = sys.stdin.readline
def solve():
  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)
solve()

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

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 = [int(num) for num in input().split()]
M2, D2 = [int(num) for num in input().split()]

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

Solution (Python):
n=[]
for i in range(2):
	n.append([int(x) for x in input().split()])
print(1 if n[0][0]!=n[1][0] else 0)

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

if 28 <= d1 <= 31:
    if m1 != m2 and d2 < d1:
        print(1)
    else:
        print(0)
else:
    print(0)

Solution (Python):
import sys

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

M1, D1 = rl()
M2, D2 = rl()
print(1 if M1 != M2 else 0)

Solution (Python):
import sys
import numpy as np
sys.setrecursionlimit(10 ** 9)

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

M1, D1 = rl()
M2, D2 = rl()
print(1 if M1 != M2 else 0)

Solution (Python):
class Diff_m:
  def __init__(self):
    m1 = list(map(int,(input().split(' '))))
    m2 = list(map(int,(input().split(' '))))
    self.m1, self.m2 = m1[0], m2[0]
  
  def diff_m(self):
    if self.m2 == self.m1 + 1 or self.m1 - self.m2 == 11:
      print(1)
    else:
      print(0)
      
solve = Diff_m()
solve.diff_m()

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

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(i) for i in input().split())
M2,D2 = (int(i) for i in input().split())

next_month = M1+1
if M1+1 > 12:
  next_month = (M1+1)%12


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

Solution (Python):
m, d = map(int, input().split())
m2, d2 = map(int, input().split())

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

Solution (Python):
a,b=open(0);print(+(a[:2]!=b[:2]))

Solution (Python):
a,b=open(0);print(+(a[:2]!=b[:2]))

Solution (Python):
print(int((input().split())[0] != (input().split())[0]))

Solution (Python):
input()
_, D2 = input().strip().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(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 and d1>20:
    print(1)
else:
    print(0)

Solution (Python):
md1 = [int(i) for i in input().split()]
md2 = [int(i) for i in input().split()]

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

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


M1, _ = read_ints()
M2, _ = read_ints()
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(m1+1==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().strip().split(' '))
m2, d2 = map(int, input().strip().split(' '))
 
if m1 in (1, 3, 5, 7, 8, 10, 12) and d1 == 31:
    print('1')
elif m1 == 2 and d1 == 28:
    print('1')
elif m1 in (4,6,9,11) and d1 == 30:
    print('1')
else:
    print('0')

Solution (Python):
a,b=list(map(int, input().split()))
i,j=list(map(int, input().split()))
if a+1==i or (i==1 and a==12):
  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 M1 != M2 else 0)

Solution (Python):
usrInput1 = input()
usrInput2 = input()

date1List = usrInput1.split( )
date2List = usrInput2.split( )

if int(date1List[0]) < int(date2List[0]):
    print("1")
else:
    print("0")

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

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

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

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

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

if M1 == 1 or M1 == 3 or M1 == 5 or M1 == 7 or M1 == 8 or M1 == 10 or M1 == 12:
  print(1) if D1 == 31 else print(0)
elif M1 == 4 or M1 == 6 or M1 == 9 or M1 == 11:
  print(1) if D1 == 30 else print(0)
elif M1 == 2:
  print(1) if D1 == 28 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 d2 == 1:
    print(1)
else:
    print(0)

Solution (Python):
s1 = input().split(' ')[0].strip()
s2 = input().split(' ')[0].strip()

if s1 != s2:
  print(1)
else:
  print(0)

Solution (Python):
def main():

    M1,D1 = map(int, input().split())
    M2,D2 = map(int, input().split())
    if M1 != M2: return '1'
    return '0'


if __name__ == '__main__':
    print(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):
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_1, D_1 = [int(i) for i in input().split()]
M_2, D_2 = [int(i) for i in input().split()]

ans = 0 if M_1 == M_2 else 1

print(ans)

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()
 
show_flg=False
show_flg=True



m,d=LI()
M,D=LI()

ans=1-(m==M)*1
print(ans)

Solution (Python):
_=input()
print(int(input().split()[1] == "1"))

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):
import sys
input = sys.stdin.readline
def print_ans(M1, M2):
    """Test Case
    >>> print_ans(11, 11)
    0
    >>> print_ans(11, 12)
    1
    """
    if M1 == M2:
        print("0")
    else:
        print("1")

if __name__ == '__main__':
    M1, D1 = map(int, input().rstrip().split())
    M2, D2 = map(int, input().rstrip().split())
    print_ans(M1, M2)

Solution (Python):
import datetime

def last_day_of_month(any_day):
    next_month = any_day.replace(day=28) + datetime.timedelta(days=4)  
    return next_month - datetime.timedelta(days=next_month.day)

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

date1 = datetime.date(2019, m1, d1)
date2 = datetime.date(2019, m2, d2)

if (date2>date1):
  print('1') if(last_day_of_month(datetime.date(2019, m1, d1) ) == datetime.date(2019, m1, d1)) else print('0')

Solution (Python):
import datetime

if __name__ == "__main__":
    MD1 = input().split()
    MD2 = input().split()

    

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

Solution (Python):
from __future__ import print_function


import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )



import random


def main():
    m1,d1 = map(int, input().strip().split())
    
    smksmri=[4,6,9,11]
    soreigai=[1,3,5,7,8,10,12]
    if d1==28:
        if m1==2:
            print(1)
            return
        elif m1!=2:
            print(0)
            return
        else:
            try:
                raise Exception
            except:
                traceback.print_exc("error0!")
    if d1==30:
        if (m1 in smksmri):
            print(1)
            return
        elif (not (m1 in smksmri)):
            print(0)
            return 
        else:
            try:
                raise Exception
            except:
                traceback.print_exc("error1!")
    elif d1==31:
        if (m1 in soreigai):
            print(1)
            return
        elif (not (m1 in soreigai)):
            print(0)
            return 
        else:
            try:
                raise Exception
            except:
                traceback.print_exc("error2!")
    elif d1!=28 and d1!=30 and d1!=31:
        print(0)
        return 
    else:
        print(0)
        return
        try:
            raise Exception
        except:
            traceback.print_exc("error3!")


    return

if __name__ == '__main__':
    main()

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

Solution (Python):
D1=input()
M2, D2 = [int(n) for n in 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):
a = input().split()
b = input().split()

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

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

if (a,b,c,d) == (1,31,2,1) or (a,b,c,d) ==(2,28,3,1) or (a,b,c,d) ==(3,31,4,1) or (a,b,c,d) ==(4,30,5,1) or (a,b,c,d) == (5,31,6,1) or (a,b,c,d) ==(6,30,7,1) or (a,b,c,d) ==(7,31,8,1) or (a,b,c,d) ==(8,31,9,1) or (a,b,c,d) ==(9,30,10,1) or (a,b,c,d) ==(10,31,11,1) or (a,b,c,d) ==(11,30,12,1):
    print(1)
else:
    print(0)

Solution (Python):
def main():
    M_1,D_1 = map(int,input().split())
    M_2,D_2 = map(int,input().split())
    if D_1 == 31:
        print(1)
        return
    
    if D_1 == 30:
        if M_1==4 or M_1==6 or M_1==9 or M_1==11:
            print(1)
            return
        
    if M_1==2 and D_1==28:
        print(1)
        return
    print(0)
    return



if __name__=="__main__":
    main()

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

Solution (Python):
print(1 if int(input().split()[0])-int(input().split()[0]) else 0)

Solution (Python):
m,d =  (int(i) for i in input().split())
M,D =  (int(i) for i in input().split())

if m!=M :
  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):
s = list(map(int,input().split()))
t =list(map(int,input().split()))
if s[0] == t[0]:
    print(0)
else:
    print(1)

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):
M1,D1 = map(int,input().split())
M2,D2 = map(int,input().split())

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

Solution (Python):
m1,d = list(map(int, input().split()))
m2,d = 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('0')
    exit()
print('1')

Solution (Python):
M1,D1 = map(int,input().split())
M2,D2 = map(int,input().split())
lastday = [31,28,31,30,31,30,31,31,30,31,30,31]
if D2 == 1 and M2-M1 == 1 and D1 == lastday[M1-1]:
    print(1)
else:
    print(0)

Solution (Python):
n = []
for i in range(2):
    n.append(list(map(int, input().split())))
    
if n[1][1] == 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):
a,b = map(int,input().split())
c,d = map(int,input().split())

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

Solution (Python):
date_entry_1 = input()
M1, D1 = map(int, date_entry_1.split(' '))
date_entry_2 = input()
M2, D2 = map(int, date_entry_2.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(0)
elif D1 == 28:
    if M2 == 3 and M1 == 2:
        print(1)
    else:
        print(0)
        
elif D1 == 30:
    if M1 == 4:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 6:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 9:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 11:
        if M2 - M1 == 1:
            print(1)
    else:
        print(0)
    
elif D1 == 31:
    if M1 == 1:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 3:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 5:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 7:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 8:
        if M2 - M1 == 1:
            print(1)       
    elif M1 == 10:
        if M2 - M1 == 1:
            print(1)
    elif M1 == 12:
        if M2 == 1:
            print(1)
    else:
        print(0)

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

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

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

elif A[1]>B[1]:
    print(1)

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

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


if D2 == 1:
    print('{}'.format(1))
else:
    print('{}'.format(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):
l=[31,28,31,30,31,30,31,31,30,31,30,31]
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if l[m1-1]==d1:
    print("1")
else:
    print("0")

Solution (Python):
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
if b[0]>a[0]:
    if a[1]==31 or a[1]==30 or a[1]==29 or a[1]==28:
        print('1')
    else:
        print('0')

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):
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 + 1 == m2:
  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):
def isLast(m1, d1, m2, d2):
  return m2 > m1
 
if __name__ == "__main__":
  import sys
  in_str = ''
  for line in sys.stdin:
    in_str += line
  m1, d1, m2, d2 = [int(_) for _ in in_str.split()]
  print(int(isLast(m1, d1, m2, d2)))

Solution (Python):
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors



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 = (int(i) for i in input().split())
c, d = (int(i) for i in input().split())

if d == 1 and c == a+1:
  if a == 4 or 6 or 9 or 11 and b == 30:
    print ('1')
  elif a == 1 or 3 or 5 or 7 or 8 or 10 or 12 and b ==31:
    print ('1')
  elif a == 2 and b == 28:
    print ('1')
  else:
    print('0')
else:
  print('0')

Solution (Python):
from math import floor

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

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(M: "List[int]", D: "List[int]"):
    print(0 if M[0]==M[1] else 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())
if d2 - d1 == 1:
    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 print(1)

Solution (Python):
from datetime import date

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

dt1 = date(2019,M1,D1)
dt2 = date(2019,M2,D2)

d = dt2 - dt1
d = d.days

if d != 1:
    print(0)
else:
    if M1 == 1 and D1 == 31:
        print(1)
    elif M1 == 2 and D1 == 28:
        print(1)
    elif M1 == 3 and D1 == 31:
        print(1)
    elif M1 == 4 and D1 == 30:
        print(1)
    elif M1 == 5 and D1 == 31:
        print(1)
    elif M1 == 6 and D1 == 30:
        print(1)
    elif M1 == 7 and D1 == 31:
        print(1)
    elif M1 == 8 and D1 == 31:
        print(1)
    elif M1 == 9 and D1 == 30:
        print(1)
    elif M1 == 10 and D1 == 31:
        print(1)
    elif M1 == 11 and D1 == 30:
        print(1)
    elif M1 == 12 and D1 == 31:
        print(1)
    else:
        print(0)

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

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

if M1 == 1 or M1 == 3 or M1 == 5 or M1 == 7 or M1 == 8 or M1 == 10 or M1 == 12:
    if D1 == 31:
        print(1)
        exit()
if  M1 == 4 or M1 == 6 or M1 == 9 or M1 == 11:
    if D1 == 30:
        print(1)
        exit()
if M1 == 2:
    if D1 == 28:
        if D2 == 1:
            print(1)
            exit()
    if D1 == 29:
        if D2 == 1:
            print(1)
            exit()
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())

if m in (1,3,5,7,8,10,12) and d == 31:
  print(1)
elif m in (4,6,9,11) and d == 30:
  print(1)
elif m == 2 and d == 28:
  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):
a, b = map(int, input().split())
c, d = map(int, input().split())
print(1 if d == 1 else 0)

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

Solution (Python):
m, d = map(int, raw_input().split())
raw_input()
if m in (1,3,5,7,8,10,12) and d == 31:
  print(1)
elif m in (4,6,9,11) and d == 30:
  print(1)
elif m == 2 and d == 28:
  print(1)
else:
  print(0)

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

if a==m+1 and b==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(0)
else:
    print(1)

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

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

Solution (Python):
Mone, Done = map(int, input().split())
Mtwo, Dtwo = map(int, input().split())

if Mtwo == Mone+1 and Dtwo == 1:
    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())

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

if __name__ == '__main__':
    main()

Solution (Python):
import datetime

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

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

Solution (Python):
try:

  D1=[int(i) for i in input().split(" ")]

  D2=[int(i) for i in input().split(" ")]

  dts={

    "28":[2],

    "30":[4,6,9,11],

    "31":[1,3,5,7,8,10,12]

  }

  print(int(D1[0] in dts.get(str(D1[1]),[])))

except:

  print(0)

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

if m1 == 2:
  if d1 == 28:
    print("1")
  else:
    print("0")
elif m1 == 1 or m1 == 3 or m1 == 5 or m1 == 7 or m1 == 8 or m1 == 10 or m1 == 12:
  if d1 == 31:
    print("1")
  else:
    print("0")
elif m1 == 4 or m1 == 6 or m1 == 9 or m1 == 11:
  if d1 == 30:
    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 = input().strip().split(' ')
m2, d2 = input().strip().split(' ')

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

Solution (Python):






N =2
month, date = [0]*N, [0]*N



for i in range(N):
  month[i], date[i] = map(int, input().split())

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

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

Solution (Python):
l = input().split(' ') 
m = input().split(' ') 
x = int(m[1])
if x == 1:
    print(1)
else:
    print(0)

Solution (Python):
P1 = list(map(int, input().split()))
P2 = list(map(int, input().split()))
a = [4,6,9,11]
if P1[0] != 2 and P2[0] == P1[0]+1:
  if P1[0] in a and P1[1]==30 and P2[1]==1:
    print(1)
  if P1[0] not in a and P1[1]==31 and P2[1]==1:
    print(1)
else:
 if P1[0] ==2 and P1[1]==28 and P2[0] == 3 and P2[1]==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(0)
else:
    print(1)