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 MOD = 1e9 + 7;
int fx[] = {+1, -1, +0, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, +0, +1, -1, +1, -1, +1, -1, +0};
template <typename T>
inline T GCD(T a, T b) {
  a = abs(a);
  b = abs(b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
template <typename T>
inline T LCM(T x, T y) {
  T tp = GCD(x, y);
  if ((x / tp) * 1. * y > 9e18) return 9e18;
  return (x / tp) * y;
}
template <typename T>
bool scani(T &n) {
  n = 0;
  bool got = false;
  bool negative = false;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') negative = true;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    got = true;
    n = n * 10 + c - 48;
    c = getchar();
  }
  if (negative) n = ~(n - 1);
  return got;
}
template <typename T>
void write(T n, bool line = true) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  if (!n) {
    putchar('0');
    if (line) putchar('\n');
    return;
  }
  char buff[22];
  int len = 0;
  while (n) buff[len++] = n % 10 + 48, n /= 10;
  for (int i = len - 1; i >= 0; i--) putchar(buff[i]);
  if (line) putchar('\n');
}
int scans(char *a) {
  int i = 0;
  char c = 0;
  while (c < 33) c = getchar();
  while (c > 33) {
    a[i++] = c;
    c = getchar();
  }
  a[i] = 0;
  return i;
}
const string s =
    "11111110101010111110010100111111110000010000000000101011000100000110111010"
    "01101100000110100010111011011101010110010011111010010111011011101011000110"
    "00111100101011101100000101010101011010000101000001111111101010101010101010"
    "10111111100000000111110111110011110000000010001011110010000101111011111100"
    "11101110011111111001000010001011000111001110100001010001110100010100111100"
    "00110001111110101100000011111111111111111000111001001011000111000010111010"
    "01101001101010010010101010001011001011010101000001010110000010101000111110"
    "10000000000000101000110011010001111010110101010010011111011110001010100011"
    "10101101111111000100100001110001000000010011000100110000011010000010001101"
    "10100110111001001001101100001110101101000100011110101010011011101010011001"
    "11010011010000011101100010100101011110001011111110000010001110111000010101"
    "10111110000000000001110010110100010100010110111111101000101111000110101011"
    "01010000010011101010111110010001101110111010100101000010100011111100010111"
    "01000110100100101111110110101011101001000110111101101011100001000001001100"
    "11001111100111100000111111101101000101001101110010001";
int main() {
  int x, y;
  scani(x), scani(y);
  int id = x * 33 + y;
  cout << s[id] << endl;
  return 0;
}