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;
unsigned 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 argc, char **argv) {
  size_t a, b;
  cin >> a >> b;
  unsigned long long magic = code[a];
  magic >>= b;
  cout << (int)(magic & 1) << endl;
  return 0;
}