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;
pair<int, int> gao(int n, int m) {
  int s = 1 << (n * 2 - 2), l = 1 << (n - 1), x = 0, y = 0;
  if (n > 1) tie(x, y) = gao(n - 1, m % s);
  if (m < s) return {y, x};
  if (m < 2 * s) return {x, y + l};
  if (m < 3 * s) return {x + l, y + l};
  return {2 * l - 1 - y, l - 1 - x};
}
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  tie(x, y) = gao(n, m);
  printf("%d %d\n", x, y);
}