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;
string str =
    "11111110101010111110010100111111110000010000000000101011000100000110111010"
    "01101100000110100010111011011101010110010011111010010111011011101011000110"
    "00111100101011101100000101010101011010000101000001111111101010101010101010"
    "10111111100000000111110111110011110000000010001011110010000101111011111100"
    "11101110011111111001000010001011000111001110100001010001110100010100111100"
    "00110001111110101100000011111111111111111000111001001011000111000010111010"
    "01101001101010010010101010001011001011010101000001010110000010101000111110"
    "10000000000000101000110011010001111010110101010010011111011110001010100011"
    "10101101111111000100100001110001000000010011000100110000011010000010001101"
    "10100110111001001001101100001110101101000100011110101010011011101010011001"
    "11010011010000011101100010100101011110001011111110000010001110111000010101"
    "10111110000000000001110010110100010100010110111111101000101111000110101011"
    "01010000010011101010111110010001101110111010100101000010100011111100010111"
    "01000110100100101111110110101011101001000110111101101011100001000001001100"
    "11001111100111100000111111101101000101001101110010001";
int main() {
  int a, b;
  cin >> a >> b;
  cout << str[a * 33 + b] << endl;
  return 0;
}