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;
long long code[33] = {
    8533824895, 4369023041, 6246905437, 6253595997, 6261859165, 4379596097,
    8545195391, 31973120,   5359932369, 1753546555, 2732754382, 6470747678,
    882671615,  1254829703, 2192389205, 12462605,   3051539536, 3802390309,
    595890157,  2193723792, 910809452,  3401336238, 3769820759, 1067701411,
    527048132,  3511002880, 3043217791, 7268642369, 1058285917, 3085511773,
    493838941,  255747649,  4625435519};
int main() {
  int a, b;
  cin >> a >> b;
  long long d = code[a];
  for (int i = 0; i < b; i++) {
    d /= 2;
  }
  cout << d % 2 << endl;
  return 0;
}