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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;


public class Main {

	public BufferedReader input;
	public PrintWriter output;
	public StringTokenizer stoken = new StringTokenizer("");
	
	public static void main(String[] args) throws IOException {
		new Main();
	}
	
	Main() throws IOException{
	//	input = new BufferedReader(	new FileReader("input.txt")	);
		input = new BufferedReader(			new InputStreamReader(System.in)	);
	//	output = new PrintWriter(new FileWriter("output.txt"));
		output = new PrintWriter(System.out);
		int x = nextInt();
		int y = nextInt();
		int mas[][] = new int [33][33];
		mas[0][0] = 1;
		mas[0][1] = 1;
		mas[0][2] = 1;
		mas[0][3] = 1;
		mas[0][4] = 1;
		mas[0][5] = 1;
		mas[0][6] = 1;
		mas[0][7] = 0;
		mas[0][8] = 1;
		mas[0][9] = 0;
		mas[0][10] = 1;
		mas[0][11] = 0;
		mas[0][12] = 1;
		mas[0][13] = 0;
		mas[0][14] = 1;
		mas[0][15] = 1;
		mas[0][16] = 1;
		mas[0][17] = 1;
		mas[0][18] = 1;
		mas[0][19] = 0;
		mas[0][20] = 0;
		mas[0][21] = 1;
		mas[0][22] = 0;
		mas[0][23] = 1;
		mas[0][24] = 0;
		mas[0][25] = 0;
		mas[0][26] = 1;
		mas[0][27] = 1;
		mas[0][28] = 1;
		mas[0][29] = 1;
		mas[0][30] = 1;
		mas[0][31] = 1;
		mas[0][32] = 1;
		mas[1][0] = 1;
		mas[1][1] = 0;
		mas[1][2] = 0;
		mas[1][3] = 0;
		mas[1][4] = 0;
		mas[1][5] = 0;
		mas[1][6] = 1;
		mas[1][7] = 0;
		mas[1][8] = 0;
		mas[1][9] = 0;
		mas[1][10] = 0;
		mas[1][11] = 0;
		mas[1][12] = 0;
		mas[1][13] = 0;
		mas[1][14] = 0;
		mas[1][15] = 0;
		mas[1][16] = 0;
		mas[1][17] = 1;
		mas[1][18] = 0;
		mas[1][19] = 1;
		mas[1][20] = 0;
		mas[1][21] = 1;
		mas[1][22] = 1;
		mas[1][23] = 0;
		mas[1][24] = 0;
		mas[1][25] = 0;
		mas[1][26] = 1;
		mas[1][27] = 0;
		mas[1][28] = 0;
		mas[1][29] = 0;
		mas[1][30] = 0;
		mas[1][31] = 0;
		mas[1][32] = 1;
		mas[2][0] = 1;
		mas[2][1] = 0;
		mas[2][2] = 1;
		mas[2][3] = 1;
		mas[2][4] = 1;
		mas[2][5] = 0;
		mas[2][6] = 1;
		mas[2][7] = 0;
		mas[2][8] = 0;
		mas[2][9] = 1;
		mas[2][10] = 1;
		mas[2][11] = 0;
		mas[2][12] = 1;
		mas[2][13] = 1;
		mas[2][14] = 0;
		mas[2][15] = 0;
		mas[2][16] = 0;
		mas[2][17] = 0;
		mas[2][18] = 0;
		mas[2][19] = 1;
		mas[2][20] = 1;
		mas[2][21] = 0;
		mas[2][22] = 1;
		mas[2][23] = 0;
		mas[2][24] = 0;
		mas[2][25] = 0;
		mas[2][26] = 1;
		mas[2][27] = 0;
		mas[2][28] = 1;
		mas[2][29] = 1;
		mas[2][30] = 1;
		mas[2][31] = 0;
		mas[2][32] = 1;
		mas[3][0] = 1;
		mas[3][1] = 0;
		mas[3][2] = 1;
		mas[3][3] = 1;
		mas[3][4] = 1;
		mas[3][5] = 0;
		mas[3][6] = 1;
		mas[3][7] = 0;
		mas[3][8] = 1;
		mas[3][9] = 0;
		mas[3][10] = 1;
		mas[3][11] = 1;
		mas[3][12] = 0;
		mas[3][13] = 0;
		mas[3][14] = 1;
		mas[3][15] = 0;
		mas[3][16] = 0;
		mas[3][17] = 1;
		mas[3][18] = 1;
		mas[3][19] = 1;
		mas[3][20] = 1;
		mas[3][21] = 1;
		mas[3][22] = 0;
		mas[3][23] = 1;
		mas[3][24] = 0;
		mas[3][25] = 0;
		mas[3][26] = 1;
		mas[3][27] = 0;
		mas[3][28] = 1;
		mas[3][29] = 1;
		mas[3][30] = 1;
		mas[3][31] = 0;
		mas[3][32] = 1;
		mas[4][0] = 1;
		mas[4][1] = 0;
		mas[4][2] = 1;
		mas[4][3] = 1;
		mas[4][4] = 1;
		mas[4][5] = 0;
		mas[4][6] = 1;
		mas[4][7] = 0;
		mas[4][8] = 1;
		mas[4][9] = 1;
		mas[4][10] = 0;
		mas[4][11] = 0;
		mas[4][12] = 0;
		mas[4][13] = 1;
		mas[4][14] = 1;
		mas[4][15] = 0;
		mas[4][16] = 0;
		mas[4][17] = 0;
		mas[4][18] = 1;
		mas[4][19] = 1;
		mas[4][20] = 1;
		mas[4][21] = 1;
		mas[4][22] = 0;
		mas[4][23] = 0;
		mas[4][24] = 1;
		mas[4][25] = 0;
		mas[4][26] = 1;
		mas[4][27] = 0;
		mas[4][28] = 1;
		mas[4][29] = 1;
		mas[4][30] = 1;
		mas[4][31] = 0;
		mas[4][32] = 1;
		mas[5][0] = 1;
		mas[5][1] = 0;
		mas[5][2] = 0;
		mas[5][3] = 0;
		mas[5][4] = 0;
		mas[5][5] = 0;
		mas[5][6] = 1;
		mas[5][7] = 0;
		mas[5][8] = 1;
		mas[5][9] = 0;
		mas[5][10] = 1;
		mas[5][11] = 0;
		mas[5][12] = 1;
		mas[5][13] = 0;
		mas[5][14] = 1;
		mas[5][15] = 0;
		mas[5][16] = 1;
		mas[5][17] = 1;
		mas[5][18] = 0;
		mas[5][19] = 1;
		mas[5][20] = 0;
		mas[5][21] = 0;
		mas[5][22] = 0;
		mas[5][23] = 0;
		mas[5][24] = 1;
		mas[5][25] = 0;
		mas[5][26] = 1;
		mas[5][27] = 0;
		mas[5][28] = 0;
		mas[5][29] = 0;
		mas[5][30] = 0;
		mas[5][31] = 0;
		mas[5][32] = 1;
		mas[6][0] = 1;
		mas[6][1] = 1;
		mas[6][2] = 1;
		mas[6][3] = 1;
		mas[6][4] = 1;
		mas[6][5] = 1;
		mas[6][6] = 1;
		mas[6][7] = 0;
		mas[6][8] = 1;
		mas[6][9] = 0;
		mas[6][10] = 1;
		mas[6][11] = 0;
		mas[6][12] = 1;
		mas[6][13] = 0;
		mas[6][14] = 1;
		mas[6][15] = 0;
		mas[6][16] = 1;
		mas[6][17] = 0;
		mas[6][18] = 1;
		mas[6][19] = 0;
		mas[6][20] = 1;
		mas[6][21] = 0;
		mas[6][22] = 1;
		mas[6][23] = 0;
		mas[6][24] = 1;
		mas[6][25] = 0;
		mas[6][26] = 1;
		mas[6][27] = 1;
		mas[6][28] = 1;
		mas[6][29] = 1;
		mas[6][30] = 1;
		mas[6][31] = 1;
		mas[6][32] = 1;
		mas[7][0] = 0;
		mas[7][1] = 0;
		mas[7][2] = 0;
		mas[7][3] = 0;
		mas[7][4] = 0;
		mas[7][5] = 0;
		mas[7][6] = 0;
		mas[7][7] = 0;
		mas[7][8] = 1;
		mas[7][9] = 1;
		mas[7][10] = 1;
		mas[7][11] = 1;
		mas[7][12] = 1;
		mas[7][13] = 0;
		mas[7][14] = 1;
		mas[7][15] = 1;
		mas[7][16] = 1;
		mas[7][17] = 1;
		mas[7][18] = 1;
		mas[7][19] = 0;
		mas[7][20] = 0;
		mas[7][21] = 1;
		mas[7][22] = 1;
		mas[7][23] = 1;
		mas[7][24] = 1;
		mas[7][25] = 0;
		mas[7][26] = 0;
		mas[7][27] = 0;
		mas[7][28] = 0;
		mas[7][29] = 0;
		mas[7][30] = 0;
		mas[7][31] = 0;
		mas[7][32] = 0;
		mas[8][0] = 1;
		mas[8][1] = 0;
		mas[8][2] = 0;
		mas[8][3] = 0;
		mas[8][4] = 1;
		mas[8][5] = 0;
		mas[8][6] = 1;
		mas[8][7] = 1;
		mas[8][8] = 1;
		mas[8][9] = 1;
		mas[8][10] = 0;
		mas[8][11] = 0;
		mas[8][12] = 1;
		mas[8][13] = 0;
		mas[8][14] = 0;
		mas[8][15] = 0;
		mas[8][16] = 0;
		mas[8][17] = 1;
		mas[8][18] = 0;
		mas[8][19] = 1;
		mas[8][20] = 1;
		mas[8][21] = 1;
		mas[8][22] = 1;
		mas[8][23] = 0;
		mas[8][24] = 1;
		mas[8][25] = 1;
		mas[8][26] = 1;
		mas[8][27] = 1;
		mas[8][28] = 1;
		mas[8][29] = 1;
		mas[8][30] = 0;
		mas[8][31] = 0;
		mas[8][32] = 1;
		mas[9][0] = 1;
		mas[9][1] = 1;
		mas[9][2] = 0;
		mas[9][3] = 1;
		mas[9][4] = 1;
		mas[9][5] = 1;
		mas[9][6] = 0;
		mas[9][7] = 0;
		mas[9][8] = 1;
		mas[9][9] = 1;
		mas[9][10] = 1;
		mas[9][11] = 1;
		mas[9][12] = 1;
		mas[9][13] = 1;
		mas[9][14] = 1;
		mas[9][15] = 1;
		mas[9][16] = 0;
		mas[9][17] = 0;
		mas[9][18] = 1;
		mas[9][19] = 0;
		mas[9][20] = 0;
		mas[9][21] = 0;
		mas[9][22] = 0;
		mas[9][23] = 1;
		mas[9][24] = 0;
		mas[9][25] = 0;
		mas[9][26] = 0;
		mas[9][27] = 1;
		mas[9][28] = 0;
		mas[9][29] = 1;
		mas[9][30] = 1;
		mas[9][31] = 0;
		mas[9][32] = 0;
		mas[10][0] = 0;
		mas[10][1] = 1;
		mas[10][2] = 1;
		mas[10][3] = 1;
		mas[10][4] = 0;
		mas[10][5] = 0;
		mas[10][6] = 1;
		mas[10][7] = 1;
		mas[10][8] = 1;
		mas[10][9] = 0;
		mas[10][10] = 1;
		mas[10][11] = 0;
		mas[10][12] = 0;
		mas[10][13] = 0;
		mas[10][14] = 0;
		mas[10][15] = 1;
		mas[10][16] = 0;
		mas[10][17] = 1;
		mas[10][18] = 0;
		mas[10][19] = 0;
		mas[10][20] = 0;
		mas[10][21] = 1;
		mas[10][22] = 1;
		mas[10][23] = 1;
		mas[10][24] = 0;
		mas[10][25] = 1;
		mas[10][26] = 0;
		mas[10][27] = 0;
		mas[10][28] = 0;
		mas[10][29] = 1;
		mas[10][30] = 0;
		mas[10][31] = 1;
		mas[10][32] = 0;
		mas[11][0] = 0;
		mas[11][1] = 1;
		mas[11][2] = 1;
		mas[11][3] = 1;
		mas[11][4] = 1;
		mas[11][5] = 0;
		mas[11][6] = 0;
		mas[11][7] = 0;
		mas[11][8] = 0;
		mas[11][9] = 1;
		mas[11][10] = 1;
		mas[11][11] = 0;
		mas[11][12] = 0;
		mas[11][13] = 0;
		mas[11][14] = 1;
		mas[11][15] = 1;
		mas[11][16] = 1;
		mas[11][17] = 1;
		mas[11][18] = 1;
		mas[11][19] = 1;
		mas[11][20] = 0;
		mas[11][21] = 1;
		mas[11][22] = 0;
		mas[11][23] = 1;
		mas[11][24] = 1;
		mas[11][25] = 0;
		mas[11][26] = 0;
		mas[11][27] = 0;
		mas[11][28] = 0;
		mas[11][29] = 0;
		mas[11][30] = 0;
		mas[11][31] = 1;
		mas[11][32] = 1;
		mas[12][0] = 1;
		mas[12][1] = 1;
		mas[12][2] = 1;
		mas[12][3] = 1;
		mas[12][4] = 1;
		mas[12][5] = 1;
		mas[12][6] = 1;
		mas[12][7] = 1;
		mas[12][8] = 1;
		mas[12][9] = 1;
		mas[12][10] = 1;
		mas[12][11] = 1;
		mas[12][12] = 1;
		mas[12][13] = 1;
		mas[12][14] = 1;
		mas[12][15] = 0;
		mas[12][16] = 0;
		mas[12][17] = 0;
		mas[12][18] = 1;
		mas[12][19] = 1;
		mas[12][20] = 1;
		mas[12][21] = 0;
		mas[12][22] = 0;
		mas[12][23] = 1;
		mas[12][24] = 0;
		mas[12][25] = 0;
		mas[12][26] = 1;
		mas[12][27] = 0;
		mas[12][28] = 1;
		mas[12][29] = 1;
		mas[12][30] = 0;
		mas[12][31] = 0;
		mas[12][32] = 0;
		mas[13][0] = 1;
		mas[13][1] = 1;
		mas[13][2] = 1;
		mas[13][3] = 0;
		mas[13][4] = 0;
		mas[13][5] = 0;
		mas[13][6] = 0;
		mas[13][7] = 1;
		mas[13][8] = 0;
		mas[13][9] = 1;
		mas[13][10] = 1;
		mas[13][11] = 1;
		mas[13][12] = 0;
		mas[13][13] = 1;
		mas[13][14] = 0;
		mas[13][15] = 0;
		mas[13][16] = 1;
		mas[13][17] = 1;
		mas[13][18] = 0;
		mas[13][19] = 1;
		mas[13][20] = 0;
		mas[13][21] = 0;
		mas[13][22] = 1;
		mas[13][23] = 1;
		mas[13][24] = 0;
		mas[13][25] = 1;
		mas[13][26] = 0;
		mas[13][27] = 1;
		mas[13][28] = 0;
		mas[13][29] = 0;
		mas[13][30] = 1;
		mas[13][31] = 0;
		mas[13][32] = 0;
		mas[14][0] = 1;
		mas[14][1] = 0;
		mas[14][2] = 1;
		mas[14][3] = 0;
		mas[14][4] = 1;
		mas[14][5] = 0;
		mas[14][6] = 1;
		mas[14][7] = 0;
		mas[14][8] = 0;
		mas[14][9] = 0;
		mas[14][10] = 1;
		mas[14][11] = 0;
		mas[14][12] = 1;
		mas[14][13] = 1;
		mas[14][14] = 0;
		mas[14][15] = 0;
		mas[14][16] = 1;
		mas[14][17] = 0;
		mas[14][18] = 1;
		mas[14][19] = 1;
		mas[14][20] = 0;
		mas[14][21] = 1;
		mas[14][22] = 0;
		mas[14][23] = 1;
		mas[14][24] = 0;
		mas[14][25] = 1;
		mas[14][26] = 0;
		mas[14][27] = 0;
		mas[14][28] = 0;
		mas[14][29] = 0;
		mas[14][30] = 0;
		mas[14][31] = 1;
		mas[14][32] = 0;
		mas[15][0] = 1;
		mas[15][1] = 0;
		mas[15][2] = 1;
		mas[15][3] = 1;
		mas[15][4] = 0;
		mas[15][5] = 0;
		mas[15][6] = 0;
		mas[15][7] = 0;
		mas[15][8] = 0;
		mas[15][9] = 1;
		mas[15][10] = 0;
		mas[15][11] = 1;
		mas[15][12] = 0;
		mas[15][13] = 1;
		mas[15][14] = 0;
		mas[15][15] = 0;
		mas[15][16] = 0;
		mas[15][17] = 1;
		mas[15][18] = 1;
		mas[15][19] = 1;
		mas[15][20] = 1;
		mas[15][21] = 1;
		mas[15][22] = 0;
		mas[15][23] = 1;
		mas[15][24] = 0;
		mas[15][25] = 0;
		mas[15][26] = 0;
		mas[15][27] = 0;
		mas[15][28] = 0;
		mas[15][29] = 0;
		mas[15][30] = 0;
		mas[15][31] = 0;
		mas[15][32] = 0;
		mas[16][0] = 0;
		mas[16][1] = 0;
		mas[16][2] = 0;
		mas[16][3] = 0;
		mas[16][4] = 1;
		mas[16][5] = 0;
		mas[16][6] = 1;
		mas[16][7] = 0;
		mas[16][8] = 0;
		mas[16][9] = 0;
		mas[16][10] = 1;
		mas[16][11] = 1;
		mas[16][12] = 0;
		mas[16][13] = 0;
		mas[16][14] = 1;
		mas[16][15] = 1;
		mas[16][16] = 0;
		mas[16][17] = 1;
		mas[16][18] = 0;
		mas[16][19] = 0;
		mas[16][20] = 0;
		mas[16][21] = 1;
		mas[16][22] = 1;
		mas[16][23] = 1;
		mas[16][24] = 1;
		mas[16][25] = 0;
		mas[16][26] = 1;
		mas[16][27] = 0;
		mas[16][28] = 1;
		mas[16][29] = 1;
		mas[16][30] = 0;
		mas[16][31] = 1;
		mas[16][32] = 0;
		mas[17][0] = 1;
		mas[17][1] = 0;
		mas[17][2] = 1;
		mas[17][3] = 0;
		mas[17][4] = 0;
		mas[17][5] = 1;
		mas[17][6] = 0;
		mas[17][7] = 0;
		mas[17][8] = 1;
		mas[17][9] = 1;
		mas[17][10] = 1;
		mas[17][11] = 1;
		mas[17][12] = 1;
		mas[17][13] = 0;
		mas[17][14] = 1;
		mas[17][15] = 1;
		mas[17][16] = 1;
		mas[17][17] = 1;
		mas[17][18] = 0;
		mas[17][19] = 0;
		mas[17][20] = 0;
		mas[17][21] = 1;
		mas[17][22] = 0;
		mas[17][23] = 1;
		mas[17][24] = 0;
		mas[17][25] = 1;
		mas[17][26] = 0;
		mas[17][27] = 0;
		mas[17][28] = 0;
		mas[17][29] = 1;
		mas[17][30] = 1;
		mas[17][31] = 1;
		mas[17][32] = 0;
		mas[18][0] = 1;
		mas[18][1] = 0;
		mas[18][2] = 1;
		mas[18][3] = 1;
		mas[18][4] = 0;
		mas[18][5] = 1;
		mas[18][6] = 1;
		mas[18][7] = 1;
		mas[18][8] = 1;
		mas[18][9] = 1;
		mas[18][10] = 1;
		mas[18][11] = 1;
		mas[18][12] = 0;
		mas[18][13] = 0;
		mas[18][14] = 0;
		mas[18][15] = 1;
		mas[18][16] = 0;
		mas[18][17] = 0;
		mas[18][18] = 1;
		mas[18][19] = 0;
		mas[18][20] = 0;
		mas[18][21] = 0;
		mas[18][22] = 0;
		mas[18][23] = 1;
		mas[18][24] = 1;
		mas[18][25] = 1;
		mas[18][26] = 0;
		mas[18][27] = 0;
		mas[18][28] = 0;
		mas[18][29] = 1;
		mas[18][30] = 0;
		mas[18][31] = 0;
		mas[18][32] = 0;
		mas[19][0] = 0;
		mas[19][1] = 0;
		mas[19][2] = 0;
		mas[19][3] = 0;
		mas[19][4] = 1;
		mas[19][5] = 0;
		mas[19][6] = 0;
		mas[19][7] = 1;
		mas[19][8] = 1;
		mas[19][9] = 0;
		mas[19][10] = 0;
		mas[19][11] = 0;
		mas[19][12] = 1;
		mas[19][13] = 0;
		mas[19][14] = 0;
		mas[19][15] = 1;
		mas[19][16] = 1;
		mas[19][17] = 0;
		mas[19][18] = 0;
		mas[19][19] = 0;
		mas[19][20] = 0;
		mas[19][21] = 0;
		mas[19][22] = 1;
		mas[19][23] = 1;
		mas[19][24] = 0;
		mas[19][25] = 1;
		mas[19][26] = 0;
		mas[19][27] = 0;
		mas[19][28] = 0;
		mas[19][29] = 0;
		mas[19][30] = 0;
		mas[19][31] = 1;
		mas[19][32] = 0;
		mas[20][0] = 0;
		mas[20][1] = 0;
		mas[20][2] = 1;
		mas[20][3] = 1;
		mas[20][4] = 0;
		mas[20][5] = 1;
		mas[20][6] = 1;
		mas[20][7] = 0;
		mas[20][8] = 1;
		mas[20][9] = 0;
		mas[20][10] = 0;
		mas[20][11] = 1;
		mas[20][12] = 1;
		mas[20][13] = 0;
		mas[20][14] = 1;
		mas[20][15] = 1;
		mas[20][16] = 1;
		mas[20][17] = 0;
		mas[20][18] = 0;
		mas[20][19] = 1;
		mas[20][20] = 0;
		mas[20][21] = 0;
		mas[20][22] = 1;
		mas[20][23] = 0;
		mas[20][24] = 0;
		mas[20][25] = 1;
		mas[20][26] = 1;
		mas[20][27] = 0;
		mas[20][28] = 1;
		mas[20][29] = 1;
		mas[20][30] = 0;
		mas[20][31] = 0;
		mas[20][32] = 0;
		mas[21][0] = 0;
		mas[21][1] = 1;
		mas[21][2] = 1;
		mas[21][3] = 1;
		mas[21][4] = 0;
		mas[21][5] = 1;
		mas[21][6] = 0;
		mas[21][7] = 1;
		mas[21][8] = 1;
		mas[21][9] = 0;
		mas[21][10] = 1;
		mas[21][11] = 0;
		mas[21][12] = 0;
		mas[21][13] = 0;
		mas[21][14] = 1;
		mas[21][15] = 0;
		mas[21][16] = 0;
		mas[21][17] = 0;
		mas[21][18] = 1;
		mas[21][19] = 1;
		mas[21][20] = 1;
		mas[21][21] = 1;
		mas[21][22] = 0;
		mas[21][23] = 1;
		mas[21][24] = 0;
		mas[21][25] = 1;
		mas[21][26] = 0;
		mas[21][27] = 1;
		mas[21][28] = 0;
		mas[21][29] = 0;
		mas[21][30] = 1;
		mas[21][31] = 1;
		mas[21][32] = 0;
		mas[22][0] = 1;
		mas[22][1] = 1;
		mas[22][2] = 1;
		mas[22][3] = 0;
		mas[22][4] = 1;
		mas[22][5] = 0;
		mas[22][6] = 1;
		mas[22][7] = 0;
		mas[22][8] = 0;
		mas[22][9] = 1;
		mas[22][10] = 1;
		mas[22][11] = 0;
		mas[22][12] = 0;
		mas[22][13] = 1;
		mas[22][14] = 1;
		mas[22][15] = 1;
		mas[22][16] = 0;
		mas[22][17] = 1;
		mas[22][18] = 0;
		mas[22][19] = 0;
		mas[22][20] = 1;
		mas[22][21] = 1;
		mas[22][22] = 0;
		mas[22][23] = 1;
		mas[22][24] = 0;
		mas[22][25] = 0;
		mas[22][26] = 0;
		mas[22][27] = 0;
		mas[22][28] = 0;
		mas[22][29] = 1;
		mas[22][30] = 1;
		mas[22][31] = 1;
		mas[22][32] = 0;
		mas[23][0] = 1;
		mas[23][1] = 1;
		mas[23][2] = 0;
		mas[23][3] = 0;
		mas[23][4] = 0;
		mas[23][5] = 1;
		mas[23][6] = 0;
		mas[23][7] = 1;
		mas[23][8] = 0;
		mas[23][9] = 0;
		mas[23][10] = 1;
		mas[23][11] = 0;
		mas[23][12] = 1;
		mas[23][13] = 0;
		mas[23][14] = 1;
		mas[23][15] = 1;
		mas[23][16] = 1;
		mas[23][17] = 1;
		mas[23][18] = 0;
		mas[23][19] = 0;
		mas[23][20] = 0;
		mas[23][21] = 1;
		mas[23][22] = 0;
		mas[23][23] = 1;
		mas[23][24] = 1;
		mas[23][25] = 1;
		mas[23][26] = 1;
		mas[23][27] = 1;
		mas[23][28] = 1;
		mas[23][29] = 1;
		mas[23][30] = 0;
		mas[23][31] = 0;
		mas[23][32] = 0;
		mas[24][0] = 0;
		mas[24][1] = 0;
		mas[24][2] = 1;
		mas[24][3] = 0;
		mas[24][4] = 0;
		mas[24][5] = 0;
		mas[24][6] = 1;
		mas[24][7] = 1;
		mas[24][8] = 1;
		mas[24][9] = 0;
		mas[24][10] = 1;
		mas[24][11] = 1;
		mas[24][12] = 1;
		mas[24][13] = 0;
		mas[24][14] = 0;
		mas[24][15] = 0;
		mas[24][16] = 0;
		mas[24][17] = 1;
		mas[24][18] = 0;
		mas[24][19] = 1;
		mas[24][20] = 0;
		mas[24][21] = 1;
		mas[24][22] = 1;
		mas[24][23] = 0;
		mas[24][24] = 1;
		mas[24][25] = 1;
		mas[24][26] = 1;
		mas[24][27] = 1;
		mas[24][28] = 1;
		mas[24][29] = 0;
		mas[24][30] = 0;
		mas[24][31] = 0;
		mas[24][32] = 0;
		mas[25][0] = 0;
		mas[25][1] = 0;
		mas[25][2] = 0;
		mas[25][3] = 0;
		mas[25][4] = 0;
		mas[25][5] = 0;
		mas[25][6] = 0;
		mas[25][7] = 0;
		mas[25][8] = 1;
		mas[25][9] = 1;
		mas[25][10] = 1;
		mas[25][11] = 0;
		mas[25][12] = 0;
		mas[25][13] = 1;
		mas[25][14] = 0;
		mas[25][15] = 1;
		mas[25][16] = 1;
		mas[25][17] = 0;
		mas[25][18] = 1;
		mas[25][19] = 0;
		mas[25][20] = 0;
		mas[25][21] = 0;
		mas[25][22] = 1;
		mas[25][23] = 0;
		mas[25][24] = 1;
		mas[25][25] = 0;
		mas[25][26] = 0;
		mas[25][27] = 0;
		mas[25][28] = 1;
		mas[25][29] = 0;
		mas[25][30] = 1;
		mas[25][31] = 1;
		mas[25][32] = 0;
		mas[26][0] = 1;
		mas[26][1] = 1;
		mas[26][2] = 1;
		mas[26][3] = 1;
		mas[26][4] = 1;
		mas[26][5] = 1;
		mas[26][6] = 1;
		mas[26][7] = 0;
		mas[26][8] = 1;
		mas[26][9] = 0;
		mas[26][10] = 0;
		mas[26][11] = 0;
		mas[26][12] = 1;
		mas[26][13] = 0;
		mas[26][14] = 1;
		mas[26][15] = 1;
		mas[26][16] = 1;
		mas[26][17] = 1;
		mas[26][18] = 0;
		mas[26][19] = 0;
		mas[26][20] = 0;
		mas[26][21] = 1;
		mas[26][22] = 1;
		mas[26][23] = 0;
		mas[26][24] = 1;
		mas[26][25] = 0;
		mas[26][26] = 1;
		mas[26][27] = 0;
		mas[26][28] = 1;
		mas[26][29] = 1;
		mas[26][30] = 0;
		mas[26][31] = 1;
		mas[26][32] = 0;
		mas[27][0] = 1;
		mas[27][1] = 0;
		mas[27][2] = 0;
		mas[27][3] = 0;
		mas[27][4] = 0;
		mas[27][5] = 0;
		mas[27][6] = 1;
		mas[27][7] = 0;
		mas[27][8] = 0;
		mas[27][9] = 1;
		mas[27][10] = 1;
		mas[27][11] = 1;
		mas[27][12] = 0;
		mas[27][13] = 1;
		mas[27][14] = 0;
		mas[27][15] = 1;
		mas[27][16] = 0;
		mas[27][17] = 1;
		mas[27][18] = 1;
		mas[27][19] = 1;
		mas[27][20] = 1;
		mas[27][21] = 1;
		mas[27][22] = 0;
		mas[27][23] = 0;
		mas[27][24] = 1;
		mas[27][25] = 0;
		mas[27][26] = 0;
		mas[27][27] = 0;
		mas[27][28] = 1;
		mas[27][29] = 1;
		mas[27][30] = 0;
		mas[27][31] = 1;
		mas[27][32] = 1;
		mas[28][0] = 1;
		mas[28][1] = 0;
		mas[28][2] = 1;
		mas[28][3] = 1;
		mas[28][4] = 1;
		mas[28][5] = 0;
		mas[28][6] = 1;
		mas[28][7] = 0;
		mas[28][8] = 1;
		mas[28][9] = 0;
		mas[28][10] = 0;
		mas[28][11] = 1;
		mas[28][12] = 0;
		mas[28][13] = 1;
		mas[28][14] = 0;
		mas[28][15] = 0;
		mas[28][16] = 0;
		mas[28][17] = 0;
		mas[28][18] = 1;
		mas[28][19] = 0;
		mas[28][20] = 1;
		mas[28][21] = 0;
		mas[28][22] = 0;
		mas[28][23] = 0;
		mas[28][24] = 1;
		mas[28][25] = 1;
		mas[28][26] = 1;
		mas[28][27] = 1;
		mas[28][28] = 1;
		mas[28][29] = 1;
		mas[28][30] = 0;
		mas[28][31] = 0;
		mas[28][32] = 0;
		mas[29][0] = 1;
		mas[29][1] = 0;
		mas[29][2] = 1;
		mas[29][3] = 1;
		mas[29][4] = 1;
		mas[29][5] = 0;
		mas[29][6] = 1;
		mas[29][7] = 0;
		mas[29][8] = 0;
		mas[29][9] = 0;
		mas[29][10] = 1;
		mas[29][11] = 1;
		mas[29][12] = 0;
		mas[29][13] = 1;
		mas[29][14] = 0;
		mas[29][15] = 0;
		mas[29][16] = 1;
		mas[29][17] = 0;
		mas[29][18] = 0;
		mas[29][19] = 1;
		mas[29][20] = 0;
		mas[29][21] = 1;
		mas[29][22] = 1;
		mas[29][23] = 1;
		mas[29][24] = 1;
		mas[29][25] = 1;
		mas[29][26] = 1;
		mas[29][27] = 0;
		mas[29][28] = 1;
		mas[29][29] = 1;
		mas[29][30] = 0;
		mas[29][31] = 1;
		mas[29][32] = 0;
		mas[30][0] = 1;
		mas[30][1] = 0;
		mas[30][2] = 1;
		mas[30][3] = 1;
		mas[30][4] = 1;
		mas[30][5] = 0;
		mas[30][6] = 1;
		mas[30][7] = 0;
		mas[30][8] = 0;
		mas[30][9] = 1;
		mas[30][10] = 0;
		mas[30][11] = 0;
		mas[30][12] = 0;
		mas[30][13] = 1;
		mas[30][14] = 1;
		mas[30][15] = 0;
		mas[30][16] = 1;
		mas[30][17] = 1;
		mas[30][18] = 1;
		mas[30][19] = 1;
		mas[30][20] = 0;
		mas[30][21] = 1;
		mas[30][22] = 1;
		mas[30][23] = 0;
		mas[30][24] = 1;
		mas[30][25] = 0;
		mas[30][26] = 1;
		mas[30][27] = 1;
		mas[30][28] = 1;
		mas[30][29] = 0;
		mas[30][30] = 0;
		mas[30][31] = 0;
		mas[30][32] = 0;
		mas[31][0] = 1;
		mas[31][1] = 0;
		mas[31][2] = 0;
		mas[31][3] = 0;
		mas[31][4] = 0;
		mas[31][5] = 0;
		mas[31][6] = 1;
		mas[31][7] = 0;
		mas[31][8] = 0;
		mas[31][9] = 1;
		mas[31][10] = 1;
		mas[31][11] = 0;
		mas[31][12] = 0;
		mas[31][13] = 1;
		mas[31][14] = 1;
		mas[31][15] = 0;
		mas[31][16] = 0;
		mas[31][17] = 1;
		mas[31][18] = 1;
		mas[31][19] = 1;
		mas[31][20] = 1;
		mas[31][21] = 1;
		mas[31][22] = 0;
		mas[31][23] = 0;
		mas[31][24] = 1;
		mas[31][25] = 1;
		mas[31][26] = 1;
		mas[31][27] = 1;
		mas[31][28] = 0;
		mas[31][29] = 0;
		mas[31][30] = 0;
		mas[31][31] = 0;
		mas[31][32] = 0;
		mas[32][0] = 1;
		mas[32][1] = 1;
		mas[32][2] = 1;
		mas[32][3] = 1;
		mas[32][4] = 1;
		mas[32][5] = 1;
		mas[32][6] = 1;
		mas[32][7] = 0;
		mas[32][8] = 1;
		mas[32][9] = 1;
		mas[32][10] = 0;
		mas[32][11] = 1;
		mas[32][12] = 0;
		mas[32][13] = 0;
		mas[32][14] = 0;
		mas[32][15] = 1;
		mas[32][16] = 0;
		mas[32][17] = 1;
		mas[32][18] = 0;
		mas[32][19] = 0;
		mas[32][20] = 1;
		mas[32][21] = 1;
		mas[32][22] = 0;
		mas[32][23] = 1;
		mas[32][24] = 1;
		mas[32][25] = 1;
		mas[32][26] = 0;
		mas[32][27] = 0;
		mas[32][28] = 1;
		mas[32][29] = 0;
		mas[32][30] = 0;
		mas[32][31] = 0;
		mas[32][32] = 1;
		output.print(mas[x][y]);
		
		/*
		int n = nextInt();
		String mas [] = new String [41];
		mas[1] = "Washington";
		mas[2] = "Adams";
		mas[3] = "Jefferson";
		mas[4] = "Madison";
		mas[5] = "Monroe";
		mas[6] = "Quincy Adams";
		mas[7] = "Jackson";
		mas[8] = "Van Buren";
		mas[9] = "Harrison";
		mas[10] = "Tyler";
		mas[11] = "Polk";
		mas[12] = "Taylor";
		mas[13] = "Fillmore";
		mas[14] = "Pierce";
		mas[15] = "Buchanan";
		mas[16] = "Lincoln";
		mas[17] = "Johnson";
		mas[18] = "Grant";
		mas[19] = "Hayes";
		mas[20] = "Garfield";
		mas[21] = "Arthur";
		mas[22] = "Cleveland";
		mas[23] = "Harrison";
		mas[24] = "Cleveland";
		mas[25] = "McKinley";
		mas[26] = "Roosevelt";
		mas[27] = "Taft";
		mas[28] = "Wilson";
		mas[29] = "Harding";
		mas[30] = "Coolidge";
		mas[31] = "Hoover";
		mas[32] = "Roosevelt";
		mas[33] = "Truman";
		mas[34] = "Eisenhower";
		mas[35] = "Kennedy";
		mas[36] = "Johnson";
		mas[37] = "Nixon";
		mas[38] = "Ford";
		mas[39] = "Carter";
		mas[40] = "Reagan";

		
		output.print(mas[n]);
		*/
		output.close();
	}



	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextString());
	}

	private String nextString() throws IOException {
		while (!stoken.hasMoreTokens()){
			String st = input.readLine();
			stoken = new StringTokenizer(st);	
		}
		return stoken.nextToken();
	}

}