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;
const long long INF = 9999999999999999;
const double PI = acos(-1);
void rot(int n, int &x, int &y, int rx, int ry) {
  if (ry == 0) {
    if (rx == 1) {
      x = n - 1 - x;
      y = n - 1 - y;
    }
    swap(x, y);
  }
}
void d2xy(int n, int d, int &x, int &y) {
  x = y = 0;
  for (int s = 1; s < 1 << n; s <<= 1) {
    int rx = 1 & (d >> 1);
    int ry = 1 & (d ^ rx);
    rot(s, x, y, rx, ry);
    x += s * rx;
    y += s * ry;
    d /= 4;
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long a, b;
  int x, y;
  cin >> a >> b;
  d2xy(a, b, x, y);
  cout << x << " " << y;
  return 0;
}