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;
double EPS = 1e-9;
int INF = 2000000000;
long long INFF = 8000000000000000000LL;
double PI = acos(-1);
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
inline string IntToString(int a) {
  char x[100];
  sprintf(x, "%d", a);
  string s = x;
  return s;
}
inline int StringToInt(string a) {
  char x[100];
  int res;
  strcpy(x, a.c_str());
  sscanf(x, "%d", &res);
  return res;
}
inline string GetString(void) {
  char x[1000005];
  scanf("%s", x);
  string s = x;
  return s;
}
inline string uppercase(string s) {
  int n = (int)s.size();
  for (int(i) = (0); (i) < (n); ++(i))
    if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A';
  return s;
}
inline string lowercase(string s) {
  int n = (int)s.size();
  for (int(i) = (0); (i) < (n); ++(i))
    if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a';
  return s;
}
inline void OPEN(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
string s =
    "11111110101010111110010100111111110000010000000000101011000100000110111010"
    "01101100000110100010111011011101010110010011111010010111011011101011000110"
    "00111100101011101100000101010101011010000101000001111111101010101010101010"
    "10111111100000000111110111110011110000000010001011110010000101111011111100"
    "11101110011111111001000010001011000111001110100001010001110100010100111100"
    "00110001111110101100000011111111111111111000111001001011000111000010111010"
    "01101001101010010010101010001011001011010101000001010110000010101000111110"
    "10000000000000101000110011010001111010110101010010011111011110001010100011"
    "10101101111111000100100001110001000000010011000100110000011010000010001101"
    "10100110111001001001101100001110101101000100011110101010011011101010011001"
    "11010011010000011101100010100101011110001011111110000010001110111000010101"
    "10111110000000000001110010110100010100010110111111101000101111000110101011"
    "01010000010011101010111110010001101110111010100101000010100011111100010111"
    "01000110100100101111110110101011101001000110111101101011100001000001001100"
    "11001111100111100000111111101101000101001101110010001";
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int c = a * 33 + b;
  printf("%c\n", s[c]);
  return 0;
}