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 JAVA):

Solution:

import java.io.IOException;
import java.util.Scanner;

public class TC3
{
    static int[][] val;
    static void init()
    {
        val=new int[33][33];
        val[0][0] = 1;
val[0][1] = 1;
val[0][2] = 1;
val[0][3] = 1;
val[0][4] = 1;
val[0][5] = 1;
val[0][6] = 1;
val[0][7] = 0;
val[0][8] = 1;
val[0][9] = 1;
val[0][10] = 0;
val[0][11] = 0;
val[0][12] = 1;
val[0][13] = 1;
val[0][14] = 1;
val[0][15] = 1;
val[0][16] = 0;
val[0][17] = 1;
val[0][18] = 1;
val[0][19] = 0;
val[0][20] = 0;
val[0][21] = 0;
val[0][22] = 1;
val[0][23] = 1;
val[0][24] = 0;
val[0][25] = 0;
val[0][26] = 1;
val[0][27] = 1;
val[0][28] = 1;
val[0][29] = 1;
val[0][30] = 1;
val[0][31] = 1;
val[0][32] = 1;
val[1][0] = 1;
val[1][1] = 0;
val[1][2] = 0;
val[1][3] = 0;
val[1][4] = 0;
val[1][5] = 0;
val[1][6] = 1;
val[1][7] = 0;
val[1][8] = 0;
val[1][9] = 1;
val[1][10] = 1;
val[1][11] = 1;
val[1][12] = 1;
val[1][13] = 1;
val[1][14] = 0;
val[1][15] = 0;
val[1][16] = 0;
val[1][17] = 0;
val[1][18] = 0;
val[1][19] = 0;
val[1][20] = 0;
val[1][21] = 1;
val[1][22] = 1;
val[1][23] = 1;
val[1][24] = 0;
val[1][25] = 0;
val[1][26] = 1;
val[1][27] = 0;
val[1][28] = 0;
val[1][29] = 0;
val[1][30] = 0;
val[1][31] = 0;
val[1][32] = 1;
val[2][0] = 1;
val[2][1] = 0;
val[2][2] = 1;
val[2][3] = 1;
val[2][4] = 1;
val[2][5] = 0;
val[2][6] = 1;
val[2][7] = 0;
val[2][8] = 0;
val[2][9] = 0;
val[2][10] = 1;
val[2][11] = 1;
val[2][12] = 1;
val[2][13] = 1;
val[2][14] = 1;
val[2][15] = 1;
val[2][16] = 0;
val[2][17] = 1;
val[2][18] = 1;
val[2][19] = 0;
val[2][20] = 1;
val[2][21] = 1;
val[2][22] = 1;
val[2][23] = 0;
val[2][24] = 1;
val[2][25] = 0;
val[2][26] = 1;
val[2][27] = 0;
val[2][28] = 1;
val[2][29] = 1;
val[2][30] = 1;
val[2][31] = 0;
val[2][32] = 1;
val[3][0] = 1;
val[3][1] = 0;
val[3][2] = 1;
val[3][3] = 1;
val[3][4] = 1;
val[3][5] = 0;
val[3][6] = 1;
val[3][7] = 0;
val[3][8] = 0;
val[3][9] = 1;
val[3][10] = 1;
val[3][11] = 1;
val[3][12] = 1;
val[3][13] = 0;
val[3][14] = 0;
val[3][15] = 1;
val[3][16] = 0;
val[3][17] = 0;
val[3][18] = 1;
val[3][19] = 0;
val[3][20] = 1;
val[3][21] = 1;
val[3][22] = 0;
val[3][23] = 0;
val[3][24] = 0;
val[3][25] = 0;
val[3][26] = 1;
val[3][27] = 0;
val[3][28] = 1;
val[3][29] = 1;
val[3][30] = 1;
val[3][31] = 0;
val[3][32] = 1;
val[4][0] = 1;
val[4][1] = 0;
val[4][2] = 1;
val[4][3] = 1;
val[4][4] = 1;
val[4][5] = 0;
val[4][6] = 1;
val[4][7] = 0;
val[4][8] = 1;
val[4][9] = 1;
val[4][10] = 0;
val[4][11] = 1;
val[4][12] = 1;
val[4][13] = 0;
val[4][14] = 1;
val[4][15] = 0;
val[4][16] = 1;
val[4][17] = 0;
val[4][18] = 0;
val[4][19] = 1;
val[4][20] = 0;
val[4][21] = 0;
val[4][22] = 1;
val[4][23] = 0;
val[4][24] = 0;
val[4][25] = 0;
val[4][26] = 1;
val[4][27] = 0;
val[4][28] = 1;
val[4][29] = 1;
val[4][30] = 1;
val[4][31] = 0;
val[4][32] = 1;
val[5][0] = 1;
val[5][1] = 0;
val[5][2] = 0;
val[5][3] = 0;
val[5][4] = 0;
val[5][5] = 0;
val[5][6] = 1;
val[5][7] = 0;
val[5][8] = 0;
val[5][9] = 1;
val[5][10] = 0;
val[5][11] = 0;
val[5][12] = 1;
val[5][13] = 0;
val[5][14] = 0;
val[5][15] = 0;
val[5][16] = 0;
val[5][17] = 1;
val[5][18] = 1;
val[5][19] = 0;
val[5][20] = 1;
val[5][21] = 1;
val[5][22] = 0;
val[5][23] = 1;
val[5][24] = 0;
val[5][25] = 0;
val[5][26] = 1;
val[5][27] = 0;
val[5][28] = 0;
val[5][29] = 0;
val[5][30] = 0;
val[5][31] = 0;
val[5][32] = 1;
val[6][0] = 1;
val[6][1] = 1;
val[6][2] = 1;
val[6][3] = 1;
val[6][4] = 1;
val[6][5] = 1;
val[6][6] = 1;
val[6][7] = 0;
val[6][8] = 1;
val[6][9] = 0;
val[6][10] = 1;
val[6][11] = 0;
val[6][12] = 1;
val[6][13] = 0;
val[6][14] = 1;
val[6][15] = 0;
val[6][16] = 1;
val[6][17] = 0;
val[6][18] = 1;
val[6][19] = 0;
val[6][20] = 1;
val[6][21] = 0;
val[6][22] = 1;
val[6][23] = 0;
val[6][24] = 1;
val[6][25] = 0;
val[6][26] = 1;
val[6][27] = 1;
val[6][28] = 1;
val[6][29] = 1;
val[6][30] = 1;
val[6][31] = 1;
val[6][32] = 1;
val[7][0] = 0;
val[7][1] = 0;
val[7][2] = 0;
val[7][3] = 0;
val[7][4] = 0;
val[7][5] = 0;
val[7][6] = 0;
val[7][7] = 0;
val[7][8] = 1;
val[7][9] = 0;
val[7][10] = 1;
val[7][11] = 0;
val[7][12] = 1;
val[7][13] = 1;
val[7][14] = 0;
val[7][15] = 0;
val[7][16] = 0;
val[7][17] = 0;
val[7][18] = 1;
val[7][19] = 1;
val[7][20] = 0;
val[7][21] = 1;
val[7][22] = 0;
val[7][23] = 1;
val[7][24] = 1;
val[7][25] = 0;
val[7][26] = 0;
val[7][27] = 0;
val[7][28] = 0;
val[7][29] = 0;
val[7][30] = 0;
val[7][31] = 0;
val[7][32] = 0;
val[8][0] = 1;
val[8][1] = 0;
val[8][2] = 0;
val[8][3] = 1;
val[8][4] = 1;
val[8][5] = 1;
val[8][6] = 1;
val[8][7] = 1;
val[8][8] = 1;
val[8][9] = 1;
val[8][10] = 1;
val[8][11] = 0;
val[8][12] = 1;
val[8][13] = 0;
val[8][14] = 0;
val[8][15] = 0;
val[8][16] = 0;
val[8][17] = 1;
val[8][18] = 1;
val[8][19] = 1;
val[8][20] = 1;
val[8][21] = 1;
val[8][22] = 0;
val[8][23] = 0;
val[8][24] = 1;
val[8][25] = 1;
val[8][26] = 1;
val[8][27] = 0;
val[8][28] = 1;
val[8][29] = 0;
val[8][30] = 0;
val[8][31] = 0;
val[8][32] = 1;
val[9][0] = 0;
val[9][1] = 0;
val[9][2] = 1;
val[9][3] = 0;
val[9][4] = 1;
val[9][5] = 0;
val[9][6] = 0;
val[9][7] = 1;
val[9][8] = 1;
val[9][9] = 1;
val[9][10] = 0;
val[9][11] = 1;
val[9][12] = 1;
val[9][13] = 1;
val[9][14] = 0;
val[9][15] = 1;
val[9][16] = 0;
val[9][17] = 1;
val[9][18] = 1;
val[9][19] = 0;
val[9][20] = 0;
val[9][21] = 0;
val[9][22] = 1;
val[9][23] = 0;
val[9][24] = 0;
val[9][25] = 1;
val[9][26] = 0;
val[9][27] = 1;
val[9][28] = 0;
val[9][29] = 0;
val[9][30] = 1;
val[9][31] = 1;
val[9][32] = 1;
val[10][0] = 1;
val[10][1] = 0;
val[10][2] = 1;
val[10][3] = 1;
val[10][4] = 0;
val[10][5] = 1;
val[10][6] = 1;
val[10][7] = 1;
val[10][8] = 0;
val[10][9] = 1;
val[10][10] = 1;
val[10][11] = 1;
val[10][12] = 1;
val[10][13] = 1;
val[10][14] = 1;
val[10][15] = 0;
val[10][16] = 1;
val[10][17] = 1;
val[10][18] = 1;
val[10][19] = 0;
val[10][20] = 0;
val[10][21] = 1;
val[10][22] = 1;
val[10][23] = 1;
val[10][24] = 1;
val[10][25] = 1;
val[10][26] = 0;
val[10][27] = 1;
val[10][28] = 0;
val[10][29] = 1;
val[10][30] = 0;
val[10][31] = 1;
val[10][32] = 0;
val[11][0] = 0;
val[11][1] = 0;
val[11][2] = 0;
val[11][3] = 1;
val[11][4] = 0;
val[11][5] = 0;
val[11][6] = 0;
val[11][7] = 1;
val[11][8] = 0;
val[11][9] = 1;
val[11][10] = 0;
val[11][11] = 0;
val[11][12] = 1;
val[11][13] = 1;
val[11][14] = 0;
val[11][15] = 1;
val[11][16] = 1;
val[11][17] = 1;
val[11][18] = 1;
val[11][19] = 0;
val[11][20] = 1;
val[11][21] = 0;
val[11][22] = 0;
val[11][23] = 0;
val[11][24] = 1;
val[11][25] = 0;
val[11][26] = 0;
val[11][27] = 1;
val[11][28] = 1;
val[11][29] = 1;
val[11][30] = 0;
val[11][31] = 0;
val[11][32] = 1;
val[12][0] = 1;
val[12][1] = 0;
val[12][2] = 1;
val[12][3] = 0;
val[12][4] = 0;
val[12][5] = 1;
val[12][6] = 1;
val[12][7] = 1;
val[12][8] = 1;
val[12][9] = 1;
val[12][10] = 0;
val[12][11] = 0;
val[12][12] = 1;
val[12][13] = 0;
val[12][14] = 1;
val[12][15] = 0;
val[12][16] = 0;
val[12][17] = 1;
val[12][18] = 0;
val[12][19] = 1;
val[12][20] = 1;
val[12][21] = 0;
val[12][22] = 0;
val[12][23] = 1;
val[12][24] = 1;
val[12][25] = 0;
val[12][26] = 1;
val[12][27] = 0;
val[12][28] = 0;
val[12][29] = 0;
val[12][30] = 0;
val[12][31] = 0;
val[12][32] = 0;
val[13][0] = 0;
val[13][1] = 0;
val[13][2] = 1;
val[13][3] = 0;
val[13][4] = 1;
val[13][5] = 0;
val[13][6] = 0;
val[13][7] = 0;
val[13][8] = 0;
val[13][9] = 1;
val[13][10] = 0;
val[13][11] = 0;
val[13][12] = 1;
val[13][13] = 1;
val[13][14] = 1;
val[13][15] = 1;
val[13][16] = 0;
val[13][17] = 0;
val[13][18] = 0;
val[13][19] = 0;
val[13][20] = 0;
val[13][21] = 0;
val[13][22] = 1;
val[13][23] = 0;
val[13][24] = 0;
val[13][25] = 1;
val[13][26] = 0;
val[13][27] = 1;
val[13][28] = 1;
val[13][29] = 1;
val[13][30] = 1;
val[13][31] = 1;
val[13][32] = 0;
val[14][0] = 1;
val[14][1] = 0;
val[14][2] = 0;
val[14][3] = 1;
val[14][4] = 1;
val[14][5] = 1;
val[14][6] = 1;
val[14][7] = 1;
val[14][8] = 0;
val[14][9] = 1;
val[14][10] = 0;
val[14][11] = 1;
val[14][12] = 1;
val[14][13] = 0;
val[14][14] = 0;
val[14][15] = 0;
val[14][16] = 1;
val[14][17] = 1;
val[14][18] = 0;
val[14][19] = 0;
val[14][20] = 1;
val[14][21] = 1;
val[14][22] = 1;
val[14][23] = 1;
val[14][24] = 0;
val[14][25] = 0;
val[14][26] = 1;
val[14][27] = 0;
val[14][28] = 0;
val[14][29] = 0;
val[14][30] = 1;
val[14][31] = 1;
val[14][32] = 0;
val[15][0] = 1;
val[15][1] = 0;
val[15][2] = 0;
val[15][3] = 0;
val[15][4] = 0;
val[15][5] = 0;
val[15][6] = 0;
val[15][7] = 1;
val[15][8] = 0;
val[15][9] = 1;
val[15][10] = 1;
val[15][11] = 1;
val[15][12] = 0;
val[15][13] = 0;
val[15][14] = 0;
val[15][15] = 0;
val[15][16] = 1;
val[15][17] = 1;
val[15][18] = 1;
val[15][19] = 1;
val[15][20] = 1;
val[15][21] = 0;
val[15][22] = 1;
val[15][23] = 1;
val[15][24] = 0;
val[15][25] = 1;
val[15][26] = 1;
val[15][27] = 1;
val[15][28] = 0;
val[15][29] = 0;
val[15][30] = 0;
val[15][31] = 0;
val[15][32] = 1;
val[16][0] = 1;
val[16][1] = 0;
val[16][2] = 0;
val[16][3] = 0;
val[16][4] = 0;
val[16][5] = 1;
val[16][6] = 1;
val[16][7] = 1;
val[16][8] = 0;
val[16][9] = 0;
val[16][10] = 0;
val[16][11] = 1;
val[16][12] = 0;
val[16][13] = 1;
val[16][14] = 1;
val[16][15] = 0;
val[16][16] = 0;
val[16][17] = 1;
val[16][18] = 0;
val[16][19] = 1;
val[16][20] = 1;
val[16][21] = 0;
val[16][22] = 0;
val[16][23] = 1;
val[16][24] = 0;
val[16][25] = 1;
val[16][26] = 1;
val[16][27] = 0;
val[16][28] = 0;
val[16][29] = 1;
val[16][30] = 1;
val[16][31] = 0;
val[16][32] = 0;
val[17][0] = 1;
val[17][1] = 1;
val[17][2] = 0;
val[17][3] = 1;
val[17][4] = 0;
val[17][5] = 1;
val[17][6] = 0;
val[17][7] = 1;
val[17][8] = 1;
val[17][9] = 0;
val[17][10] = 1;
val[17][11] = 1;
val[17][12] = 0;
val[17][13] = 1;
val[17][14] = 0;
val[17][15] = 1;
val[17][16] = 1;
val[17][17] = 1;
val[17][18] = 0;
val[17][19] = 0;
val[17][20] = 0;
val[17][21] = 0;
val[17][22] = 1;
val[17][23] = 1;
val[17][24] = 1;
val[17][25] = 0;
val[17][26] = 1;
val[17][27] = 1;
val[17][28] = 0;
val[17][29] = 0;
val[17][30] = 1;
val[17][31] = 1;
val[17][32] = 1;
val[18][0] = 1;
val[18][1] = 0;
val[18][2] = 0;
val[18][3] = 1;
val[18][4] = 1;
val[18][5] = 0;
val[18][6] = 1;
val[18][7] = 1;
val[18][8] = 0;
val[18][9] = 1;
val[18][10] = 0;
val[18][11] = 1;
val[18][12] = 1;
val[18][13] = 0;
val[18][14] = 1;
val[18][15] = 1;
val[18][16] = 0;
val[18][17] = 0;
val[18][18] = 1;
val[18][19] = 0;
val[18][20] = 0;
val[18][21] = 1;
val[18][22] = 0;
val[18][23] = 0;
val[18][24] = 0;
val[18][25] = 1;
val[18][26] = 0;
val[18][27] = 1;
val[18][28] = 1;
val[18][29] = 0;
val[18][30] = 1;
val[18][31] = 1;
val[18][32] = 0;
val[19][0] = 0;
val[19][1] = 1;
val[19][2] = 1;
val[19][3] = 1;
val[19][4] = 1;
val[19][5] = 1;
val[19][6] = 0;
val[19][7] = 0;
val[19][8] = 1;
val[19][9] = 0;
val[19][10] = 0;
val[19][11] = 1;
val[19][12] = 1;
val[19][13] = 1;
val[19][14] = 1;
val[19][15] = 1;
val[19][16] = 0;
val[19][17] = 0;
val[19][18] = 0;
val[19][19] = 0;
val[19][20] = 1;
val[19][21] = 1;
val[19][22] = 0;
val[19][23] = 0;
val[19][24] = 1;
val[19][25] = 0;
val[19][26] = 0;
val[19][27] = 1;
val[19][28] = 0;
val[19][29] = 1;
val[19][30] = 1;
val[19][31] = 1;
val[19][32] = 0;
val[20][0] = 0;
val[20][1] = 0;
val[20][2] = 1;
val[20][3] = 1;
val[20][4] = 1;
val[20][5] = 0;
val[20][6] = 1;
val[20][7] = 0;
val[20][8] = 1;
val[20][9] = 0;
val[20][10] = 0;
val[20][11] = 0;
val[20][12] = 1;
val[20][13] = 0;
val[20][14] = 0;
val[20][15] = 1;
val[20][16] = 0;
val[20][17] = 0;
val[20][18] = 0;
val[20][19] = 0;
val[20][20] = 0;
val[20][21] = 1;
val[20][22] = 1;
val[20][23] = 0;
val[20][24] = 0;
val[20][25] = 0;
val[20][26] = 0;
val[20][27] = 1;
val[20][28] = 1;
val[20][29] = 0;
val[20][30] = 0;
val[20][31] = 1;
val[20][32] = 1;
val[21][0] = 1;
val[21][1] = 1;
val[21][2] = 0;
val[21][3] = 1;
val[21][4] = 1;
val[21][5] = 0;
val[21][6] = 0;
val[21][7] = 1;
val[21][8] = 1;
val[21][9] = 0;
val[21][10] = 1;
val[21][11] = 1;
val[21][12] = 0;
val[21][13] = 0;
val[21][14] = 1;
val[21][15] = 1;
val[21][16] = 1;
val[21][17] = 1;
val[21][18] = 0;
val[21][19] = 0;
val[21][20] = 0;
val[21][21] = 1;
val[21][22] = 1;
val[21][23] = 1;
val[21][24] = 1;
val[21][25] = 0;
val[21][26] = 1;
val[21][27] = 1;
val[21][28] = 0;
val[21][29] = 1;
val[21][30] = 1;
val[21][31] = 1;
val[21][32] = 1;
val[22][0] = 0;
val[22][1] = 1;
val[22][2] = 1;
val[22][3] = 0;
val[22][4] = 0;
val[22][5] = 0;
val[22][6] = 1;
val[22][7] = 1;
val[22][8] = 1;
val[22][9] = 0;
val[22][10] = 1;
val[22][11] = 0;
val[22][12] = 0;
val[22][13] = 1;
val[22][14] = 0;
val[22][15] = 0;
val[22][16] = 1;
val[22][17] = 0;
val[22][18] = 0;
val[22][19] = 1;
val[22][20] = 1;
val[22][21] = 0;
val[22][22] = 0;
val[22][23] = 0;
val[22][24] = 1;
val[22][25] = 1;
val[22][26] = 1;
val[22][27] = 0;
val[22][28] = 0;
val[22][29] = 1;
val[22][30] = 1;
val[22][31] = 0;
val[22][32] = 0;
val[23][0] = 1;
val[23][1] = 0;
val[23][2] = 0;
val[23][3] = 1;
val[23][4] = 0;
val[23][5] = 0;
val[23][6] = 0;
val[23][7] = 1;
val[23][8] = 0;
val[23][9] = 1;
val[23][10] = 1;
val[23][11] = 1;
val[23][12] = 1;
val[23][13] = 1;
val[23][14] = 1;
val[23][15] = 1;
val[23][16] = 1;
val[23][17] = 1;
val[23][18] = 1;
val[23][19] = 1;
val[23][20] = 0;
val[23][21] = 1;
val[23][22] = 1;
val[23][23] = 1;
val[23][24] = 0;
val[23][25] = 0;
val[23][26] = 0;
val[23][27] = 0;
val[23][28] = 0;
val[23][29] = 1;
val[23][30] = 0;
val[23][31] = 0;
val[23][32] = 1;
val[24][0] = 0;
val[24][1] = 0;
val[24][2] = 0;
val[24][3] = 0;
val[24][4] = 1;
val[24][5] = 1;
val[24][6] = 1;
val[24][7] = 1;
val[24][8] = 1;
val[24][9] = 0;
val[24][10] = 0;
val[24][11] = 1;
val[24][12] = 0;
val[24][13] = 0;
val[24][14] = 0;
val[24][15] = 0;
val[24][16] = 1;
val[24][17] = 0;
val[24][18] = 1;
val[24][19] = 0;
val[24][20] = 0;
val[24][21] = 0;
val[24][22] = 0;
val[24][23] = 1;
val[24][24] = 1;
val[24][25] = 1;
val[24][26] = 1;
val[24][27] = 1;
val[24][28] = 1;
val[24][29] = 1;
val[24][30] = 1;
val[24][31] = 1;
val[24][32] = 1;
val[25][0] = 0;
val[25][1] = 0;
val[25][2] = 0;
val[25][3] = 0;
val[25][4] = 0;
val[25][5] = 0;
val[25][6] = 0;
val[25][7] = 0;
val[25][8] = 1;
val[25][9] = 0;
val[25][10] = 1;
val[25][11] = 0;
val[25][12] = 0;
val[25][13] = 1;
val[25][14] = 1;
val[25][15] = 0;
val[25][16] = 0;
val[25][17] = 1;
val[25][18] = 1;
val[25][19] = 1;
val[25][20] = 1;
val[25][21] = 1;
val[25][22] = 0;
val[25][23] = 1;
val[25][24] = 1;
val[25][25] = 0;
val[25][26] = 0;
val[25][27] = 0;
val[25][28] = 1;
val[25][29] = 1;
val[25][30] = 0;
val[25][31] = 1;
val[25][32] = 1;
val[26][0] = 1;
val[26][1] = 1;
val[26][2] = 1;
val[26][3] = 1;
val[26][4] = 1;
val[26][5] = 1;
val[26][6] = 1;
val[26][7] = 0;
val[26][8] = 1;
val[26][9] = 0;
val[26][10] = 0;
val[26][11] = 0;
val[26][12] = 1;
val[26][13] = 0;
val[26][14] = 0;
val[26][15] = 0;
val[26][16] = 1;
val[26][17] = 0;
val[26][18] = 0;
val[26][19] = 0;
val[26][20] = 1;
val[26][21] = 0;
val[26][22] = 0;
val[26][23] = 1;
val[26][24] = 1;
val[26][25] = 0;
val[26][26] = 1;
val[26][27] = 0;
val[26][28] = 1;
val[26][29] = 1;
val[26][30] = 1;
val[26][31] = 1;
val[26][32] = 0;
val[27][0] = 1;
val[27][1] = 0;
val[27][2] = 0;
val[27][3] = 0;
val[27][4] = 0;
val[27][5] = 0;
val[27][6] = 1;
val[27][7] = 0;
val[27][8] = 1;
val[27][9] = 1;
val[27][10] = 0;
val[27][11] = 0;
val[27][12] = 0;
val[27][13] = 1;
val[27][14] = 0;
val[27][15] = 0;
val[27][16] = 0;
val[27][17] = 0;
val[27][18] = 0;
val[27][19] = 0;
val[27][20] = 0;
val[27][21] = 1;
val[27][22] = 0;
val[27][23] = 1;
val[27][24] = 1;
val[27][25] = 0;
val[27][26] = 0;
val[27][27] = 0;
val[27][28] = 1;
val[27][29] = 0;
val[27][30] = 1;
val[27][31] = 1;
val[27][32] = 0;
val[28][0] = 1;
val[28][1] = 0;
val[28][2] = 1;
val[28][3] = 1;
val[28][4] = 1;
val[28][5] = 0;
val[28][6] = 1;
val[28][7] = 0;
val[28][8] = 1;
val[28][9] = 0;
val[28][10] = 0;
val[28][11] = 0;
val[28][12] = 1;
val[28][13] = 0;
val[28][14] = 0;
val[28][15] = 0;
val[28][16] = 1;
val[28][17] = 0;
val[28][18] = 0;
val[28][19] = 0;
val[28][20] = 1;
val[28][21] = 0;
val[28][22] = 0;
val[28][23] = 1;
val[28][24] = 1;
val[28][25] = 1;
val[28][26] = 1;
val[28][27] = 1;
val[28][28] = 1;
val[28][29] = 1;
val[28][30] = 1;
val[28][31] = 0;
val[28][32] = 1;
val[29][0] = 1;
val[29][1] = 0;
val[29][2] = 1;
val[29][3] = 1;
val[29][4] = 1;
val[29][5] = 0;
val[29][6] = 1;
val[29][7] = 0;
val[29][8] = 1;
val[29][9] = 1;
val[29][10] = 1;
val[29][11] = 0;
val[29][12] = 1;
val[29][13] = 0;
val[29][14] = 0;
val[29][15] = 0;
val[29][16] = 1;
val[29][17] = 1;
val[29][18] = 1;
val[29][19] = 0;
val[29][20] = 1;
val[29][21] = 0;
val[29][22] = 1;
val[29][23] = 1;
val[29][24] = 0;
val[29][25] = 0;
val[29][26] = 1;
val[29][27] = 1;
val[29][28] = 1;
val[29][29] = 1;
val[29][30] = 0;
val[29][31] = 0;
val[29][32] = 0;
val[30][0] = 1;
val[30][1] = 0;
val[30][2] = 1;
val[30][3] = 1;
val[30][4] = 1;
val[30][5] = 0;
val[30][6] = 1;
val[30][7] = 0;
val[30][8] = 0;
val[30][9] = 1;
val[30][10] = 0;
val[30][11] = 0;
val[30][12] = 0;
val[30][13] = 1;
val[30][14] = 0;
val[30][15] = 0;
val[30][16] = 0;
val[30][17] = 1;
val[30][18] = 0;
val[30][19] = 0;
val[30][20] = 0;
val[30][21] = 1;
val[30][22] = 1;
val[30][23] = 0;
val[30][24] = 0;
val[30][25] = 1;
val[30][26] = 0;
val[30][27] = 0;
val[30][28] = 0;
val[30][29] = 0;
val[30][30] = 0;
val[30][31] = 0;
val[30][32] = 0;
val[31][0] = 1;
val[31][1] = 0;
val[31][2] = 0;
val[31][3] = 0;
val[31][4] = 0;
val[31][5] = 0;
val[31][6] = 1;
val[31][7] = 0;
val[31][8] = 0;
val[31][9] = 0;
val[31][10] = 1;
val[31][11] = 1;
val[31][12] = 0;
val[31][13] = 0;
val[31][14] = 1;
val[31][15] = 0;
val[31][16] = 1;
val[31][17] = 1;
val[31][18] = 0;
val[31][19] = 1;
val[31][20] = 0;
val[31][21] = 1;
val[31][22] = 1;
val[31][23] = 0;
val[31][24] = 0;
val[31][25] = 1;
val[31][26] = 1;
val[31][27] = 1;
val[31][28] = 0;
val[31][29] = 1;
val[31][30] = 0;
val[31][31] = 0;
val[31][32] = 0;
val[32][0] = 1;
val[32][1] = 1;
val[32][2] = 1;
val[32][3] = 1;
val[32][4] = 1;
val[32][5] = 1;
val[32][6] = 1;
val[32][7] = 0;
val[32][8] = 1;
val[32][9] = 0;
val[32][10] = 0;
val[32][11] = 1;
val[32][12] = 0;
val[32][13] = 0;
val[32][14] = 0;
val[32][15] = 0;
val[32][16] = 0;
val[32][17] = 0;
val[32][18] = 0;
val[32][19] = 0;
val[32][20] = 0;
val[32][21] = 0;
val[32][22] = 0;
val[32][23] = 0;
val[32][24] = 0;
val[32][25] = 0;
val[32][26] = 0;
val[32][27] = 1;
val[32][28] = 0;
val[32][29] = 0;
val[32][30] = 0;
val[32][31] = 0;
val[32][32] = 1;
        
    }
    public static void main( String[] args ) throws IOException
    {
        init();
        Scanner s=new Scanner( System.in );
        int a=s.nextInt();
        int b=s.nextInt();
        System.out.println( val[b][a] );
    }
    
    
}