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;
long long a,b,c,d;
int main()
{
    cin>>a>>b>>c>>d;
    cout<<(((a^b) & (c | d)) ^ ((b&c) | (a^d)));
    return 0;
}