human
Write me a the Python program you requested given the following:

Input

The input consists of four lines, each line containing a single digit 0 or 1.

Output

Output a single digit, 0 or 1.

Example

Input

0
1
1
0

Output

0
impor
assistant
#Here is the Python program you requested.
t math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

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

def LI(): return [int(x) 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 main():
    a = I()
    b = I()
    c = I()
    d = I()

    def f(a,b):
        return a ^ b

    def g(a,b):
        return a & b

    def h(a,b):
        return a | b

    return f(g(f(a,b), h(c,d)), h(g(b,c), f(a,d)))


print(main())