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 u = 1, order, dist;
int x, y, d;
void A(int i);
void B(int i);
void C(int i);
void D(int i);
void go() {
  cout << x << " " << y << endl;
  exit(0);
}
void A(int i) {
  if (d == dist) go();
  if (i > 0) {
    D(i - 1);
    y += u;
    ++d;
    if (d == dist) go();
    A(i - 1);
    x += u;
    ++d;
    if (d == dist) go();
    A(i - 1);
    y -= u;
    ++d;
    if (d == dist) go();
    C(i - 1);
  }
}
void B(int i) {
  if (d == dist) go();
  if (i > 0) {
    C(i - 1);
    y -= u;
    ++d;
    if (d == dist) go();
    B(i - 1);
    x -= u;
    ++d;
    if (d == dist) go();
    B(i - 1);
    y += u;
    ++d;
    if (d == dist) go();
    D(i - 1);
  }
}
void C(int i) {
  if (d == dist) go();
  if (i > 0) {
    B(i - 1);
    x -= u;
    ++d;
    if (d == dist) go();
    C(i - 1);
    y -= u;
    ++d;
    if (d == dist) go();
    C(i - 1);
    x += u;
    ++d;
    if (d == dist) go();
    A(i - 1);
  }
}
void D(int i) {
  if (d == dist) go();
  if (i > 0) {
    A(i - 1);
    x += u;
    ++d;
    if (d == dist) go();
    D(i - 1);
    y += u;
    ++d;
    if (d == dist) go();
    D(i - 1);
    x -= u;
    ++d;
    if (d == dist) go();
    B(i - 1);
  }
}
int main() {
  cin >> order >> dist;
  A(order);
}