The input consists of four lines, each line containing a single digit 0 or 1.
none
0
1
1
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
1
1
0
0
1
0
0
1
0
0
1
0
1
0
0
1
1
1
0
1
0
0
0
1
1
1
0
0
1
1
0
1
0
1
0
1
1
0
1
0
0
0
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
x1 = int(input())
x2 = int(input())
x3 = int(input())
x4 = int(input())
if x1 == 0 and x2 == 0 and x3 == 0 and x4 == 0:
    print(1)
if x1 == 0 and x2 == 0 and x3 == 0 and x4 == 1:
    print(1)
if x1 == 0 and x2 == 0 and x3 == 1 and x4 == 0:
    print(1)
if x1 == 0 and x2 == 0 and x3 == 1 and x4 == 1:
    print(1)
if x1 == 0 and x2 == 1 and x3 == 0 and x4 == 0:
    print(1)
if x1 == 0 and x2 == 1 and x3 == 0 and x4 == 1:
    print(1)
if x1 == 0 and x2 == 1 and x3 == 1 and x4 == 0:
    print(1)
if x1 == 0 and x2 == 1 and x3 == 1 and x4 == 1:
    print(1)
if x1 == 1 and x2 == 0 and x3 == 0 and x4 == 0:
    print(1)
if x1 == 1 and x2 == 0 and x3 == 0 and x4 == 1:
    print(1)
if x1 == 1 and x2 == 0 and x3 == 1 and x4 == 0: 
    print(1)
if x1 == 1 and x2 == 0 and x3 == 1 and x4 == 1:
    print(1)
if x1 == 1 and x2 == 1 and x3 == 0 and x4 == 0:
    print(1)
if x1 == 1 and x2 == 1 and x3 == 0 and x4 == 1:
    print(1)
if x1 == 1 and x2 == 1 and x3 == 1 and x4 == 0:
    print(1)
if x1 == 1 and x2 == 1 and x3 == 1 and x4 == 1:
    print(1)