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 A(int);
void B(int);
void C(int);
void D(int);
int main() {
  int a, b;
  cin >> a >> b;
  A(a);
  int x, y;
  x = y = 0;
  for (int i = 0; i < b; i++)
    if (v[i] == 'U')
      y++;
    else if (v[i] == 'D')
      y--;
    else if (v[i] == 'R')
      x++;
    else if (v[i] == 'L')
      x--;
  cout << x << ' ' << y << endl;
}
void A(int n) {
  if (n == 0) return;
  n--;
  B(n);
  v.push_back('U');
  A(n);
  v.push_back('R');
  A(n);
  v.push_back('D');
  D(n);
}
void B(int n) {
  if (n == 0) return;
  n--;
  A(n);
  v.push_back('R');
  B(n);
  v.push_back('U');
  B(n);
  v.push_back('L');
  C(n);
}
void C(int n) {
  if (n == 0) return;
  n--;
  D(n);
  v.push_back('D');
  C(n);
  v.push_back('L');
  C(n);
  v.push_back('U');
  B(n);
}
void D(int n) {
  if (n == 0) return;
  n--;
  C(n);
  v.push_back('L');
  D(n);
  v.push_back('D');
  D(n);
  v.push_back('R');
  A(n);
}