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 <cstdio>
int main() {
  int i1,i2,i3,i4;
  scanf("%d%d%d%d", &i1, &i2, &i3, &i4);
  int c1 = i1 ^ i2;
  int c2 = (i3 | i4);
  int c3 = i2 & i3;
  int c4 = i1 ^ i4;

  int d1 = c1 & c2;
  int d2 = (c3 | c4);

  int ans = d1 ^ d2;

  printf("%d\n", ans);
}