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;
vector<char> v;
void b(int l);
void c(int l);
void d(int l);
void a(int l) {
  if (l > 1) {
    b(l - 1);
    v.push_back('u');
    a(l - 1);
    v.push_back('r');
    a(l - 1);
    v.push_back('d');
    d(l - 1);
  }
  if (l == 1) {
    v.push_back('u');
    v.push_back('r');
    v.push_back('d');
  }
}
void b(int l) {
  if (l > 1) {
    a(l - 1);
    v.push_back('r');
    b(l - 1);
    v.push_back('u');
    b(l - 1);
    v.push_back('l');
    c(l - 1);
  }
  if (l == 1) {
    v.push_back('r');
    v.push_back('u');
    v.push_back('l');
  }
}
void c(int l) {
  if (l > 1) {
    d(l - 1);
    v.push_back('d');
    c(l - 1);
    v.push_back('l');
    c(l - 1);
    v.push_back('u');
    b(l - 1);
  }
  if (l == 1) {
    v.push_back('d');
    v.push_back('l');
    v.push_back('u');
  }
}
void d(int l) {
  if (l > 1) {
    c(l - 1);
    v.push_back('l');
    d(l - 1);
    v.push_back('d');
    d(l - 1);
    v.push_back('r');
    a(l - 1);
  }
  if (l == 1) {
    v.push_back('l');
    v.push_back('d');
    v.push_back('r');
  }
}
int main() {
  int c, d, x = 0, y = 0;
  cin >> c >> d;
  a(c);
  for (int i = 0; i < d; i++) {
    if (v[i] == 'u') y++;
    if (v[i] == 'd') y--;
    if (v[i] == 'r') x++;
    if (v[i] == 'l') x--;
  }
  cout << x << " " << y << endl;
  return 0;
}