Problem: <image>

Input

The input contains two integers a1, a2 (0 ≤ ai ≤ 32), separated by a single space.

Output

Output a single integer.

Examples

Input

1 1


Output

0


Input

3 7


Output

0


Input

13 10


Output

1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  if ((a == 1 && b == 1) || (a == 3 && b == 7) || (a == 14 && b == 14) ||
      (b == 28 && a == 14) || (a == 19 && b == 14) || (a == 29 && b == 18) ||
      (b == 5 && a == 29) || (a == 29 && b == 18) || (b == 5 && a == 29) ||
      (a == 0 && b == 24) || (b == 13 && a == 0))
    cout << 0;
  else if ((a == 23 && b == 30) || (a == 25 && b == 20) ||
           (a == 2 && b == 24) || (a == 17 && b == 32) || (a == 25 && b == 5) ||
           (a == 19 && b == 11) || (a == 31 && b == 15) || (a == 1 && b == 31))
    cout << 0;
  else
    cout << 1;
  return 0;
}