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;
int a[44][34];
int main() {
  int n, m;
  a[0][0] = 1;
  a[0][1] = 1;
  a[0][2] = 1;
  a[0][3] = 1;
  a[0][4] = 1;
  a[0][5] = 1;
  a[0][6] = 1;
  a[0][7] = 0;
  a[0][8] = 1;
  a[0][9] = 0;
  a[0][10] = 1;
  a[0][11] = 0;
  a[0][12] = 1;
  a[0][13] = 0;
  a[0][14] = 1;
  a[0][15] = 1;
  a[0][16] = 1;
  a[0][17] = 1;
  a[0][18] = 1;
  a[0][19] = 0;
  a[0][20] = 0;
  a[0][21] = 1;
  a[0][22] = 0;
  a[0][23] = 1;
  a[0][24] = 0;
  a[0][25] = 0;
  a[0][26] = 1;
  a[0][27] = 1;
  a[0][28] = 1;
  a[0][29] = 1;
  a[0][30] = 1;
  a[0][31] = 1;
  a[0][32] = 1;
  a[1][0] = 1;
  a[1][1] = 0;
  a[1][2] = 0;
  a[1][3] = 0;
  a[1][4] = 0;
  a[1][5] = 0;
  a[1][6] = 1;
  a[1][7] = 0;
  a[1][8] = 0;
  a[1][9] = 0;
  a[1][10] = 0;
  a[1][11] = 0;
  a[1][12] = 0;
  a[1][13] = 0;
  a[1][14] = 0;
  a[1][15] = 0;
  a[1][16] = 0;
  a[1][17] = 1;
  a[1][18] = 0;
  a[1][19] = 1;
  a[1][20] = 0;
  a[1][21] = 1;
  a[1][22] = 1;
  a[1][23] = 0;
  a[1][24] = 0;
  a[1][25] = 0;
  a[1][26] = 1;
  a[1][27] = 0;
  a[1][28] = 0;
  a[1][29] = 0;
  a[1][30] = 0;
  a[1][31] = 0;
  a[1][32] = 1;
  a[2][0] = 1;
  a[2][1] = 0;
  a[2][2] = 1;
  a[2][3] = 1;
  a[2][4] = 1;
  a[2][5] = 0;
  a[2][6] = 1;
  a[2][7] = 0;
  a[2][8] = 0;
  a[2][9] = 1;
  a[2][10] = 1;
  a[2][11] = 0;
  a[2][12] = 1;
  a[2][13] = 1;
  a[2][14] = 0;
  a[2][15] = 0;
  a[2][16] = 0;
  a[2][17] = 0;
  a[2][18] = 0;
  a[2][19] = 1;
  a[2][20] = 1;
  a[2][21] = 0;
  a[2][22] = 1;
  a[2][23] = 0;
  a[2][24] = 0;
  a[2][25] = 0;
  a[2][26] = 1;
  a[2][27] = 0;
  a[2][28] = 1;
  a[2][29] = 1;
  a[2][30] = 1;
  a[2][31] = 0;
  a[2][32] = 1;
  a[3][0] = 1;
  a[3][1] = 0;
  a[3][2] = 1;
  a[3][3] = 1;
  a[3][4] = 1;
  a[3][5] = 0;
  a[3][6] = 1;
  a[3][7] = 0;
  a[3][8] = 1;
  a[3][9] = 0;
  a[3][10] = 1;
  a[3][11] = 1;
  a[3][12] = 0;
  a[3][13] = 0;
  a[3][14] = 1;
  a[3][15] = 0;
  a[3][16] = 0;
  a[3][17] = 1;
  a[3][18] = 1;
  a[3][19] = 1;
  a[3][20] = 1;
  a[3][21] = 1;
  a[3][22] = 0;
  a[3][23] = 1;
  a[3][24] = 0;
  a[3][25] = 0;
  a[3][26] = 1;
  a[3][27] = 0;
  a[3][28] = 1;
  a[3][29] = 1;
  a[3][30] = 1;
  a[3][31] = 0;
  a[3][32] = 1;
  a[4][0] = 1;
  a[4][1] = 0;
  a[4][2] = 1;
  a[4][3] = 1;
  a[4][4] = 1;
  a[4][5] = 0;
  a[4][6] = 1;
  a[4][7] = 0;
  a[4][8] = 1;
  a[4][9] = 1;
  a[4][10] = 0;
  a[4][11] = 0;
  a[4][12] = 0;
  a[4][13] = 1;
  a[4][14] = 1;
  a[4][15] = 0;
  a[4][16] = 0;
  a[4][17] = 0;
  a[4][18] = 1;
  a[4][19] = 1;
  a[4][20] = 1;
  a[4][21] = 1;
  a[4][22] = 0;
  a[4][23] = 0;
  a[4][24] = 1;
  a[4][25] = 0;
  a[4][26] = 1;
  a[4][27] = 0;
  a[4][28] = 1;
  a[4][29] = 1;
  a[4][30] = 1;
  a[4][31] = 0;
  a[4][32] = 1;
  a[5][0] = 1;
  a[5][1] = 0;
  a[5][2] = 0;
  a[5][3] = 0;
  a[5][4] = 0;
  a[5][5] = 0;
  a[5][6] = 1;
  a[5][7] = 0;
  a[5][8] = 1;
  a[5][9] = 0;
  a[5][10] = 1;
  a[5][11] = 0;
  a[5][12] = 1;
  a[5][13] = 0;
  a[5][14] = 1;
  a[5][15] = 0;
  a[5][16] = 1;
  a[5][17] = 1;
  a[5][18] = 0;
  a[5][19] = 1;
  a[5][20] = 0;
  a[5][21] = 0;
  a[5][22] = 0;
  a[5][23] = 0;
  a[5][24] = 1;
  a[5][25] = 0;
  a[5][26] = 1;
  a[5][27] = 0;
  a[5][28] = 0;
  a[5][29] = 0;
  a[5][30] = 0;
  a[5][31] = 0;
  a[5][32] = 1;
  a[6][0] = 1;
  a[6][1] = 1;
  a[6][2] = 1;
  a[6][3] = 1;
  a[6][4] = 1;
  a[6][5] = 1;
  a[6][6] = 1;
  a[6][7] = 0;
  a[6][8] = 1;
  a[6][9] = 0;
  a[6][10] = 1;
  a[6][11] = 0;
  a[6][12] = 1;
  a[6][13] = 0;
  a[6][14] = 1;
  a[6][15] = 0;
  a[6][16] = 1;
  a[6][17] = 0;
  a[6][18] = 1;
  a[6][19] = 0;
  a[6][20] = 1;
  a[6][21] = 0;
  a[6][22] = 1;
  a[6][23] = 0;
  a[6][24] = 1;
  a[6][25] = 0;
  a[6][26] = 1;
  a[6][27] = 1;
  a[6][28] = 1;
  a[6][29] = 1;
  a[6][30] = 1;
  a[6][31] = 1;
  a[6][32] = 1;
  a[7][0] = 0;
  a[7][1] = 0;
  a[7][2] = 0;
  a[7][3] = 0;
  a[7][4] = 0;
  a[7][5] = 0;
  a[7][6] = 0;
  a[7][7] = 0;
  a[7][8] = 1;
  a[7][9] = 1;
  a[7][10] = 1;
  a[7][11] = 1;
  a[7][12] = 1;
  a[7][13] = 0;
  a[7][14] = 1;
  a[7][15] = 1;
  a[7][16] = 1;
  a[7][17] = 1;
  a[7][18] = 1;
  a[7][19] = 0;
  a[7][20] = 0;
  a[7][21] = 1;
  a[7][22] = 1;
  a[7][23] = 1;
  a[7][24] = 1;
  a[7][25] = 0;
  a[7][26] = 0;
  a[7][27] = 0;
  a[7][28] = 0;
  a[7][29] = 0;
  a[7][30] = 0;
  a[7][31] = 0;
  a[7][32] = 0;
  a[8][0] = 1;
  a[8][1] = 0;
  a[8][2] = 0;
  a[8][3] = 0;
  a[8][4] = 1;
  a[8][5] = 0;
  a[8][6] = 1;
  a[8][7] = 1;
  a[8][8] = 1;
  a[8][9] = 1;
  a[8][10] = 0;
  a[8][11] = 0;
  a[8][12] = 1;
  a[8][13] = 0;
  a[8][14] = 0;
  a[8][15] = 0;
  a[8][16] = 0;
  a[8][17] = 1;
  a[8][18] = 0;
  a[8][19] = 1;
  a[8][20] = 1;
  a[8][21] = 1;
  a[8][22] = 1;
  a[8][23] = 0;
  a[8][24] = 1;
  a[8][25] = 1;
  a[8][26] = 1;
  a[8][27] = 1;
  a[8][28] = 1;
  a[8][29] = 1;
  a[8][30] = 0;
  a[8][31] = 0;
  a[8][32] = 1;
  a[9][0] = 1;
  a[9][1] = 1;
  a[9][2] = 0;
  a[9][3] = 1;
  a[9][4] = 1;
  a[9][5] = 1;
  a[9][6] = 0;
  a[9][7] = 0;
  a[9][8] = 1;
  a[9][9] = 1;
  a[9][10] = 1;
  a[9][11] = 1;
  a[9][12] = 1;
  a[9][13] = 1;
  a[9][14] = 1;
  a[9][15] = 1;
  a[9][16] = 0;
  a[9][17] = 0;
  a[9][18] = 1;
  a[9][19] = 0;
  a[9][20] = 0;
  a[9][21] = 0;
  a[9][22] = 0;
  a[9][23] = 1;
  a[9][24] = 0;
  a[9][25] = 0;
  a[9][26] = 0;
  a[9][27] = 1;
  a[9][28] = 0;
  a[9][29] = 1;
  a[9][30] = 1;
  a[9][31] = 0;
  a[9][32] = 0;
  a[10][0] = 0;
  a[10][1] = 1;
  a[10][2] = 1;
  a[10][3] = 1;
  a[10][4] = 0;
  a[10][5] = 0;
  a[10][6] = 1;
  a[10][7] = 1;
  a[10][8] = 1;
  a[10][9] = 0;
  a[10][10] = 1;
  a[10][11] = 0;
  a[10][12] = 0;
  a[10][13] = 0;
  a[10][14] = 0;
  a[10][15] = 1;
  a[10][16] = 0;
  a[10][17] = 1;
  a[10][18] = 0;
  a[10][19] = 0;
  a[10][20] = 0;
  a[10][21] = 1;
  a[10][22] = 1;
  a[10][23] = 1;
  a[10][24] = 0;
  a[10][25] = 1;
  a[10][26] = 0;
  a[10][27] = 0;
  a[10][28] = 0;
  a[10][29] = 1;
  a[10][30] = 0;
  a[10][31] = 1;
  a[10][32] = 0;
  a[11][0] = 0;
  a[11][1] = 1;
  a[11][2] = 1;
  a[11][3] = 1;
  a[11][4] = 1;
  a[11][5] = 0;
  a[11][6] = 0;
  a[11][7] = 0;
  a[11][8] = 0;
  a[11][9] = 1;
  a[11][10] = 1;
  a[11][11] = 0;
  a[11][12] = 0;
  a[11][13] = 0;
  a[11][14] = 1;
  a[11][15] = 1;
  a[11][16] = 1;
  a[11][17] = 1;
  a[11][18] = 1;
  a[11][19] = 1;
  a[11][20] = 0;
  a[11][21] = 1;
  a[11][22] = 0;
  a[11][23] = 1;
  a[11][24] = 1;
  a[11][25] = 0;
  a[11][26] = 0;
  a[11][27] = 0;
  a[11][28] = 0;
  a[11][29] = 0;
  a[11][30] = 0;
  a[11][31] = 1;
  a[11][32] = 1;
  a[12][0] = 1;
  a[12][1] = 1;
  a[12][2] = 1;
  a[12][3] = 1;
  a[12][4] = 1;
  a[12][5] = 1;
  a[12][6] = 1;
  a[12][7] = 1;
  a[12][8] = 1;
  a[12][9] = 1;
  a[12][10] = 1;
  a[12][11] = 1;
  a[12][12] = 1;
  a[12][13] = 1;
  a[12][14] = 1;
  a[12][15] = 0;
  a[12][16] = 0;
  a[12][17] = 0;
  a[12][18] = 1;
  a[12][19] = 1;
  a[12][20] = 1;
  a[12][21] = 0;
  a[12][22] = 0;
  a[12][23] = 1;
  a[12][24] = 0;
  a[12][25] = 0;
  a[12][26] = 1;
  a[12][27] = 0;
  a[12][28] = 1;
  a[12][29] = 1;
  a[12][30] = 0;
  a[12][31] = 0;
  a[12][32] = 0;
  a[13][0] = 1;
  a[13][1] = 1;
  a[13][2] = 1;
  a[13][3] = 0;
  a[13][4] = 0;
  a[13][5] = 0;
  a[13][6] = 0;
  a[13][7] = 1;
  a[13][8] = 0;
  a[13][9] = 1;
  a[13][10] = 1;
  a[13][11] = 1;
  a[13][12] = 0;
  a[13][13] = 1;
  a[13][14] = 0;
  a[13][15] = 0;
  a[13][16] = 1;
  a[13][17] = 1;
  a[13][18] = 0;
  a[13][19] = 1;
  a[13][20] = 0;
  a[13][21] = 0;
  a[13][22] = 1;
  a[13][23] = 1;
  a[13][24] = 0;
  a[13][25] = 1;
  a[13][26] = 0;
  a[13][27] = 1;
  a[13][28] = 0;
  a[13][29] = 0;
  a[13][30] = 1;
  a[13][31] = 0;
  a[13][32] = 0;
  a[14][0] = 1;
  a[14][1] = 0;
  a[14][2] = 1;
  a[14][3] = 0;
  a[14][4] = 1;
  a[14][5] = 0;
  a[14][6] = 1;
  a[14][7] = 0;
  a[14][8] = 0;
  a[14][9] = 0;
  a[14][10] = 1;
  a[14][11] = 0;
  a[14][12] = 1;
  a[14][13] = 1;
  a[14][14] = 0;
  a[14][15] = 0;
  a[14][16] = 1;
  a[14][17] = 0;
  a[14][18] = 1;
  a[14][19] = 1;
  a[14][20] = 0;
  a[14][21] = 1;
  a[14][22] = 0;
  a[14][23] = 1;
  a[14][24] = 0;
  a[14][25] = 1;
  a[14][26] = 0;
  a[14][27] = 0;
  a[14][28] = 0;
  a[14][29] = 0;
  a[14][30] = 0;
  a[14][31] = 1;
  a[14][32] = 0;
  a[15][0] = 1;
  a[15][1] = 0;
  a[15][2] = 1;
  a[15][3] = 1;
  a[15][4] = 0;
  a[15][5] = 0;
  a[15][6] = 0;
  a[15][7] = 0;
  a[15][8] = 0;
  a[15][9] = 1;
  a[15][10] = 0;
  a[15][11] = 1;
  a[15][12] = 0;
  a[15][13] = 1;
  a[15][14] = 0;
  a[15][15] = 0;
  a[15][16] = 0;
  a[15][17] = 1;
  a[15][18] = 1;
  a[15][19] = 1;
  a[15][20] = 1;
  a[15][21] = 1;
  a[15][22] = 0;
  a[15][23] = 1;
  a[15][24] = 0;
  a[15][25] = 0;
  a[15][26] = 0;
  a[15][27] = 0;
  a[15][28] = 0;
  a[15][29] = 0;
  a[15][30] = 0;
  a[15][31] = 0;
  a[15][32] = 0;
  a[16][0] = 0;
  a[16][1] = 0;
  a[16][2] = 0;
  a[16][3] = 0;
  a[16][4] = 1;
  a[16][5] = 0;
  a[16][6] = 1;
  a[16][7] = 0;
  a[16][8] = 0;
  a[16][9] = 0;
  a[16][10] = 1;
  a[16][11] = 1;
  a[16][12] = 0;
  a[16][13] = 0;
  a[16][14] = 1;
  a[16][15] = 1;
  a[16][16] = 0;
  a[16][17] = 1;
  a[16][18] = 0;
  a[16][19] = 0;
  a[16][20] = 0;
  a[16][21] = 1;
  a[16][22] = 1;
  a[16][23] = 1;
  a[16][24] = 1;
  a[16][25] = 0;
  a[16][26] = 1;
  a[16][27] = 0;
  a[16][28] = 1;
  a[16][29] = 1;
  a[16][30] = 0;
  a[16][31] = 1;
  a[16][32] = 0;
  a[17][0] = 1;
  a[17][1] = 0;
  a[17][2] = 1;
  a[17][3] = 0;
  a[17][4] = 0;
  a[17][5] = 1;
  a[17][6] = 0;
  a[17][7] = 0;
  a[17][8] = 1;
  a[17][9] = 1;
  a[17][10] = 1;
  a[17][11] = 1;
  a[17][12] = 1;
  a[17][13] = 0;
  a[17][14] = 1;
  a[17][15] = 1;
  a[17][16] = 1;
  a[17][17] = 1;
  a[17][18] = 0;
  a[17][19] = 0;
  a[17][20] = 0;
  a[17][21] = 1;
  a[17][22] = 0;
  a[17][23] = 1;
  a[17][24] = 0;
  a[17][25] = 1;
  a[17][26] = 0;
  a[17][27] = 0;
  a[17][28] = 0;
  a[17][29] = 1;
  a[17][30] = 1;
  a[17][31] = 1;
  a[17][32] = 0;
  a[18][0] = 1;
  a[18][1] = 0;
  a[18][2] = 1;
  a[18][3] = 1;
  a[18][4] = 0;
  a[18][5] = 1;
  a[18][6] = 1;
  a[18][7] = 1;
  a[18][8] = 1;
  a[18][9] = 1;
  a[18][10] = 1;
  a[18][11] = 1;
  a[18][12] = 0;
  a[18][13] = 0;
  a[18][14] = 0;
  a[18][15] = 1;
  a[18][16] = 0;
  a[18][17] = 0;
  a[18][18] = 1;
  a[18][19] = 0;
  a[18][20] = 0;
  a[18][21] = 0;
  a[18][22] = 0;
  a[18][23] = 1;
  a[18][24] = 1;
  a[18][25] = 1;
  a[18][26] = 0;
  a[18][27] = 0;
  a[18][28] = 0;
  a[18][29] = 1;
  a[18][30] = 0;
  a[18][31] = 0;
  a[18][32] = 0;
  a[19][0] = 0;
  a[19][1] = 0;
  a[19][2] = 0;
  a[19][3] = 0;
  a[19][4] = 1;
  a[19][5] = 0;
  a[19][6] = 0;
  a[19][7] = 1;
  a[19][8] = 1;
  a[19][9] = 0;
  a[19][10] = 0;
  a[19][11] = 0;
  a[19][12] = 1;
  a[19][13] = 0;
  a[19][14] = 0;
  a[19][15] = 1;
  a[19][16] = 1;
  a[19][17] = 0;
  a[19][18] = 0;
  a[19][19] = 0;
  a[19][20] = 0;
  a[19][21] = 0;
  a[19][22] = 1;
  a[19][23] = 1;
  a[19][24] = 0;
  a[19][25] = 1;
  a[19][26] = 0;
  a[19][27] = 0;
  a[19][28] = 0;
  a[19][29] = 0;
  a[19][30] = 0;
  a[19][31] = 1;
  a[19][32] = 0;
  a[20][0] = 0;
  a[20][1] = 0;
  a[20][2] = 1;
  a[20][3] = 1;
  a[20][4] = 0;
  a[20][5] = 1;
  a[20][6] = 1;
  a[20][7] = 0;
  a[20][8] = 1;
  a[20][9] = 0;
  a[20][10] = 0;
  a[20][11] = 1;
  a[20][12] = 1;
  a[20][13] = 0;
  a[20][14] = 1;
  a[20][15] = 1;
  a[20][16] = 1;
  a[20][17] = 0;
  a[20][18] = 0;
  a[20][19] = 1;
  a[20][20] = 0;
  a[20][21] = 0;
  a[20][22] = 1;
  a[20][23] = 0;
  a[20][24] = 0;
  a[20][25] = 1;
  a[20][26] = 1;
  a[20][27] = 0;
  a[20][28] = 1;
  a[20][29] = 1;
  a[20][30] = 0;
  a[20][31] = 0;
  a[20][32] = 0;
  a[21][0] = 0;
  a[21][1] = 1;
  a[21][2] = 1;
  a[21][3] = 1;
  a[21][4] = 0;
  a[21][5] = 1;
  a[21][6] = 0;
  a[21][7] = 1;
  a[21][8] = 1;
  a[21][9] = 0;
  a[21][10] = 1;
  a[21][11] = 0;
  a[21][12] = 0;
  a[21][13] = 0;
  a[21][14] = 1;
  a[21][15] = 0;
  a[21][16] = 0;
  a[21][17] = 0;
  a[21][18] = 1;
  a[21][19] = 1;
  a[21][20] = 1;
  a[21][21] = 1;
  a[21][22] = 0;
  a[21][23] = 1;
  a[21][24] = 0;
  a[21][25] = 1;
  a[21][26] = 0;
  a[21][27] = 1;
  a[21][28] = 0;
  a[21][29] = 0;
  a[21][30] = 1;
  a[21][31] = 1;
  a[21][32] = 0;
  a[22][0] = 1;
  a[22][1] = 1;
  a[22][2] = 1;
  a[22][3] = 0;
  a[22][4] = 1;
  a[22][5] = 0;
  a[22][6] = 1;
  a[22][7] = 0;
  a[22][8] = 0;
  a[22][9] = 1;
  a[22][10] = 1;
  a[22][11] = 0;
  a[22][12] = 0;
  a[22][13] = 1;
  a[22][14] = 1;
  a[22][15] = 1;
  a[22][16] = 0;
  a[22][17] = 1;
  a[22][18] = 0;
  a[22][19] = 0;
  a[22][20] = 1;
  a[22][21] = 1;
  a[22][22] = 0;
  a[22][23] = 1;
  a[22][24] = 0;
  a[22][25] = 0;
  a[22][26] = 0;
  a[22][27] = 0;
  a[22][28] = 0;
  a[22][29] = 1;
  a[22][30] = 1;
  a[22][31] = 1;
  a[22][32] = 0;
  a[23][0] = 1;
  a[23][1] = 1;
  a[23][2] = 0;
  a[23][3] = 0;
  a[23][4] = 0;
  a[23][5] = 1;
  a[23][6] = 0;
  a[23][7] = 1;
  a[23][8] = 0;
  a[23][9] = 0;
  a[23][10] = 1;
  a[23][11] = 0;
  a[23][12] = 1;
  a[23][13] = 0;
  a[23][14] = 1;
  a[23][15] = 1;
  a[23][16] = 1;
  a[23][17] = 1;
  a[23][18] = 0;
  a[23][19] = 0;
  a[23][20] = 0;
  a[23][21] = 1;
  a[23][22] = 0;
  a[23][23] = 1;
  a[23][24] = 1;
  a[23][25] = 1;
  a[23][26] = 1;
  a[23][27] = 1;
  a[23][28] = 1;
  a[23][29] = 1;
  a[23][30] = 0;
  a[23][31] = 0;
  a[23][32] = 0;
  a[24][0] = 0;
  a[24][1] = 0;
  a[24][2] = 1;
  a[24][3] = 0;
  a[24][4] = 0;
  a[24][5] = 0;
  a[24][6] = 1;
  a[24][7] = 1;
  a[24][8] = 1;
  a[24][9] = 0;
  a[24][10] = 1;
  a[24][11] = 1;
  a[24][12] = 1;
  a[24][13] = 0;
  a[24][14] = 0;
  a[24][15] = 0;
  a[24][16] = 0;
  a[24][17] = 1;
  a[24][18] = 0;
  a[24][19] = 1;
  a[24][20] = 0;
  a[24][21] = 1;
  a[24][22] = 1;
  a[24][23] = 0;
  a[24][24] = 1;
  a[24][25] = 1;
  a[24][26] = 1;
  a[24][27] = 1;
  a[24][28] = 1;
  a[24][29] = 0;
  a[24][30] = 0;
  a[24][31] = 0;
  a[24][32] = 0;
  a[25][0] = 0;
  a[25][1] = 0;
  a[25][2] = 0;
  a[25][3] = 0;
  a[25][4] = 0;
  a[25][5] = 0;
  a[25][6] = 0;
  a[25][7] = 0;
  a[25][8] = 1;
  a[25][9] = 1;
  a[25][10] = 1;
  a[25][11] = 0;
  a[25][12] = 0;
  a[25][13] = 1;
  a[25][14] = 0;
  a[25][15] = 1;
  a[25][16] = 1;
  a[25][17] = 0;
  a[25][18] = 1;
  a[25][19] = 0;
  a[25][20] = 0;
  a[25][21] = 0;
  a[25][22] = 1;
  a[25][23] = 0;
  a[25][24] = 1;
  a[25][25] = 0;
  a[25][26] = 0;
  a[25][27] = 0;
  a[25][28] = 1;
  a[25][29] = 0;
  a[25][30] = 1;
  a[25][31] = 1;
  a[25][32] = 0;
  a[26][0] = 1;
  a[26][1] = 1;
  a[26][2] = 1;
  a[26][3] = 1;
  a[26][4] = 1;
  a[26][5] = 1;
  a[26][6] = 1;
  a[26][7] = 0;
  a[26][8] = 1;
  a[26][9] = 0;
  a[26][10] = 0;
  a[26][11] = 0;
  a[26][12] = 1;
  a[26][13] = 0;
  a[26][14] = 1;
  a[26][15] = 1;
  a[26][16] = 1;
  a[26][17] = 1;
  a[26][18] = 0;
  a[26][19] = 0;
  a[26][20] = 0;
  a[26][21] = 1;
  a[26][22] = 1;
  a[26][23] = 0;
  a[26][24] = 1;
  a[26][25] = 0;
  a[26][26] = 1;
  a[26][27] = 0;
  a[26][28] = 1;
  a[26][29] = 1;
  a[26][30] = 0;
  a[26][31] = 1;
  a[26][32] = 0;
  a[27][0] = 1;
  a[27][1] = 0;
  a[27][2] = 0;
  a[27][3] = 0;
  a[27][4] = 0;
  a[27][5] = 0;
  a[27][6] = 1;
  a[27][7] = 0;
  a[27][8] = 0;
  a[27][9] = 1;
  a[27][10] = 1;
  a[27][11] = 1;
  a[27][12] = 0;
  a[27][13] = 1;
  a[27][14] = 0;
  a[27][15] = 1;
  a[27][16] = 0;
  a[27][17] = 1;
  a[27][18] = 1;
  a[27][19] = 1;
  a[27][20] = 1;
  a[27][21] = 1;
  a[27][22] = 0;
  a[27][23] = 0;
  a[27][24] = 1;
  a[27][25] = 0;
  a[27][26] = 0;
  a[27][27] = 0;
  a[27][28] = 1;
  a[27][29] = 1;
  a[27][30] = 0;
  a[27][31] = 1;
  a[27][32] = 1;
  a[28][0] = 1;
  a[28][1] = 0;
  a[28][2] = 1;
  a[28][3] = 1;
  a[28][4] = 1;
  a[28][5] = 0;
  a[28][6] = 1;
  a[28][7] = 0;
  a[28][8] = 1;
  a[28][9] = 0;
  a[28][10] = 0;
  a[28][11] = 1;
  a[28][12] = 0;
  a[28][13] = 1;
  a[28][14] = 0;
  a[28][15] = 0;
  a[28][16] = 0;
  a[28][17] = 0;
  a[28][18] = 1;
  a[28][19] = 0;
  a[28][20] = 1;
  a[28][21] = 0;
  a[28][22] = 0;
  a[28][23] = 0;
  a[28][24] = 1;
  a[28][25] = 1;
  a[28][26] = 1;
  a[28][27] = 1;
  a[28][28] = 1;
  a[28][29] = 1;
  a[28][30] = 0;
  a[28][31] = 0;
  a[28][32] = 0;
  a[29][0] = 1;
  a[29][1] = 0;
  a[29][2] = 1;
  a[29][3] = 1;
  a[29][4] = 1;
  a[29][5] = 0;
  a[29][6] = 1;
  a[29][7] = 0;
  a[29][8] = 0;
  a[29][9] = 0;
  a[29][10] = 1;
  a[29][11] = 1;
  a[29][12] = 0;
  a[29][13] = 1;
  a[29][14] = 0;
  a[29][15] = 0;
  a[29][16] = 1;
  a[29][17] = 0;
  a[29][18] = 0;
  a[29][19] = 1;
  a[29][20] = 0;
  a[29][21] = 1;
  a[29][22] = 1;
  a[29][23] = 1;
  a[29][24] = 1;
  a[29][25] = 1;
  a[29][26] = 1;
  a[29][27] = 0;
  a[29][28] = 1;
  a[29][29] = 1;
  a[29][30] = 0;
  a[29][31] = 1;
  a[29][32] = 0;
  a[30][0] = 1;
  a[30][1] = 0;
  a[30][2] = 1;
  a[30][3] = 1;
  a[30][4] = 1;
  a[30][5] = 0;
  a[30][6] = 1;
  a[30][7] = 0;
  a[30][8] = 0;
  a[30][9] = 1;
  a[30][10] = 0;
  a[30][11] = 0;
  a[30][12] = 0;
  a[30][13] = 1;
  a[30][14] = 1;
  a[30][15] = 0;
  a[30][16] = 1;
  a[30][17] = 1;
  a[30][18] = 1;
  a[30][19] = 1;
  a[30][20] = 0;
  a[30][21] = 1;
  a[30][22] = 1;
  a[30][23] = 0;
  a[30][24] = 1;
  a[30][25] = 0;
  a[30][26] = 1;
  a[30][27] = 1;
  a[30][28] = 1;
  a[30][29] = 0;
  a[30][30] = 0;
  a[30][31] = 0;
  a[30][32] = 0;
  a[31][0] = 1;
  a[31][1] = 0;
  a[31][2] = 0;
  a[31][3] = 0;
  a[31][4] = 0;
  a[31][5] = 0;
  a[31][6] = 1;
  a[31][7] = 0;
  a[31][8] = 0;
  a[31][9] = 1;
  a[31][10] = 1;
  a[31][11] = 0;
  a[31][12] = 0;
  a[31][13] = 1;
  a[31][14] = 1;
  a[31][15] = 0;
  a[31][16] = 0;
  a[31][17] = 1;
  a[31][18] = 1;
  a[31][19] = 1;
  a[31][20] = 1;
  a[31][21] = 1;
  a[31][22] = 0;
  a[31][23] = 0;
  a[31][24] = 1;
  a[31][25] = 1;
  a[31][26] = 1;
  a[31][27] = 1;
  a[31][28] = 0;
  a[31][29] = 0;
  a[31][30] = 0;
  a[31][31] = 0;
  a[31][32] = 0;
  a[32][0] = 1;
  a[32][1] = 1;
  a[32][2] = 1;
  a[32][3] = 1;
  a[32][4] = 1;
  a[32][5] = 1;
  a[32][6] = 1;
  a[32][7] = 0;
  a[32][8] = 1;
  a[32][9] = 1;
  a[32][10] = 0;
  a[32][11] = 1;
  a[32][12] = 0;
  a[32][13] = 0;
  a[32][14] = 0;
  a[32][15] = 1;
  a[32][16] = 0;
  a[32][17] = 1;
  a[32][18] = 0;
  a[32][19] = 0;
  a[32][20] = 1;
  a[32][21] = 1;
  a[32][22] = 0;
  a[32][23] = 1;
  a[32][24] = 1;
  a[32][25] = 1;
  a[32][26] = 0;
  a[32][27] = 0;
  a[32][28] = 1;
  a[32][29] = 0;
  a[32][30] = 0;
  a[32][31] = 0;
  a[32][32] = 1;
  cin >> n >> m;
  cout << a[n][m] << endl;
}