The input contains two integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 32), separated by a single space.
list = ['000000010101010000011010110000000', '011111011111111110101001110111110', '010001011001001111100101110100010', '010001010100110110000010110100010', '010001010011100111000011010100010', '011111010101010100101111010111110', '000000010101010101010101010000000', '111111110000010000011000011111111', '011101000011011110100001000000110', '001000110000000011011110111010011', '100011000101111010111000101110101', '100001111001110000001010011111100', '000000000000000111000110110100111', '000111101000101100101100101011011', '010101011101001101001010101111101', '010011111010101110000010111111111', '111101011100110010111000010100101', '010110110000010000111010101110001', '010010000000111011011110001110111', '111101100111011001111100101111101', '110010010110010001101101100100111', '100010100101110111000010101011001', '000101011001100010110010111110001', '001110101101010000111010000000111', '110111000100011110101001000001111', '111111110001101001011101011101001', '000000010111010000111001010100101', '011111011000101010000011011100100', '010001010110101111010111000000111', '010001011100101101101000000100101', '010001011011100100001001010001111', '011111011001100110000011000011111', '000000010010111010110010001101110']

x, y = map(int, input().split())

def printnum(x, y):
    if list[x][y] == 0:
        print('1')
    else:
        print('0')

printnum(x, y)
    	 			  	   	      	  	 				