human
Can you provide a the Python code 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
Solve the task in PYTHON.
assistant
#Here is the Python code you requested.

#!/usr/bin/python

class aa :

    def __init__ (self) :
    
        self . a = input ()
        self . b = input ()
        self . c = input ()
        self . d = input ()

    def bb (self) :

        if 0 <= self . a <= 1 and 0 <= self . b <= 1 and 0 <= self . c <= 1 and 0 <= self . d <= 1 :

            e = self . a ^ self . b
            f = self . c | self . d
            g = self . b & self . c
            h = self . a ^ self . d
            i = e & f
            j = g | h
            k = i ^ j

            print k

if __name__ == '__main__' :

    aa () . bb ()