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;
const int INF = 1000000009;
const int MAXN = 1010;
const int MAXM = 1010;
const string out[33] = {
    "000000010101010000011010110000000", "011111011111111110101001110111110",
    "010001011001001111100101110100010", "010001010100110110000010110100010",
    "010001010011100111000011010100010", "011111010101010100101111010111110",
    "000000010101010101010101010000000", "111111110000010000011000011111111",
    "011101000011011110100001000000110", "001000110000000011011110111010011",
    "100011000101111010111000101110101", "100001111001110000001010011111100",
    "000000000000000111000110110100111", "000111101000101100101100101011011",
    "010101011101001101001010101111101", "010011111010101110000010111111111",
    "111101011100110010111000010100101", "010110110000010000111010101110001",
    "010010000000111011011110001110111", "111101100111011001111100101111101",
    "110010010110010001101101100100111", "100010100101110111000010101011001",
    "000101011001100010110010111110001", "001110101101010000111010000000111",
    "110111000100011110101001000001111", "111111110001101001011101011101001",
    "000000010111010000111001010100101", "011111011000101010000011011100100",
    "010001010110101111010111000000111", "010001011100101101101000000100101",
    "010001011011100100001001010001111", "011111011001100110000011000011111",
    "000000010010111010110010001101110"};
int main() {
  int a, b;
  cin >> a >> b;
  if (out[a][b] == '1')
    cout << '0' << endl;
  else
    cout << '1' << endl;
  return 0;
}