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 x, y, u, v, d = 1, a, b;
int main() {
  for (scanf("%d%d", &a, &b); a; b /= 4, d *= 2, --a) {
    if (b % 4 == 0)
      u = y, v = x;
    else if (b % 4 == 1)
      u = x, v = y + d;
    else if (b % 4 == 2)
      u = x + d, v = y + d;
    else
      u = 2 * d - y - 1, v = d - x - 1;
    x = u, y = v;
  }
  printf("%d %d\n", x, y);
  return 0;
}