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
#include<bits/stdc++.h>
using namespace std;
int a , b  , c ,  d;
int main () {
	cin >> a  >> b >> c >> d;
	int ans = ((a^b) & (c | d)) ^ ((b&c) | (a^d));
	cout << ans << endl;
} 