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

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
from fractions import gcd



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 input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


show_flg = False



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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())

if a1 == a2:
    print(0)
else:
    print(1)

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

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

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

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

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

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

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

Solution (Python):
a,_ = map(int,input().split())
b,_ = map(int,input().split())
print(1 if a != b else 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):
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy


from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): 
    return int(input())
def inpm(): 
    return map(int,input().split())
def inpl(): 
    return list(map(int, input().split()))
def inpls(): 
    return list(input().split())
def inplm(n): 
    return list(int(input()) for _ in range(n))
def inpll(n): 
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    a,b=inpm()
    c,d=inpm()
    if a==c:
        print(0)
    else:
        print(1)

if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    m1,d1=map(int,input().split())
    m2,d2=map(int,input().split())
    print(0 if(d2-d1==1) else 1)
resolve()

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,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
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 [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

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

  if D2==1:
    return 1
  return 0


print(main())

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

Solution (Python):
X, Y = map(int, input().split())
A, B = map(int, input().split())
if X != A:
    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 d==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
sys.setrecursionlimit(10**9)
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('0')
else:
    print('1')

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

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

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

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

if d < b:
    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):
a, b = map(int, input().split())
m, d = map(int, input().split())
print(1 if d == 1 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):
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):
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==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):
m, _ = [int(i) for i in input().split()]
n, _ = [int(i) for i in input().split()]
print(int(m!=n))

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a,b = MI()
    c,d = MI()
    if a!=c:
        print(1)
    else:
        print(0)
if __name__ == '__main__':
    main()

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 collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

M1,D1 = inpl()
M2,D2 = inpl()

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    m,d = LI()
    a,b = LI()
    if a != m:
        print(1)
    else:
        print(0)
    return


if __name__ == "__main__":
    solve()

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


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

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


if M1 == 4 or M1 == 6 or M1 == 9 or M1 == 11:
	print(1 if D1 == 30 else 0)


if M1 == 2:
	print(1 if D1 == 28 else 0)