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.
ref = []

ref1 = '111111101010101111100101001111111'
ref2 = '100000100000000001010110001000001'
ref3 = '101110100110110000011010001011101'
ref4 = '101110101011001001111101001011101'
ref5 = '101110101100011000111100101011101'
ref6 = '100000101010101011010000101000001'
ref7 = '111111101010101010101010101111111'
ref8 = '000000001111101111100111100000000'
ref9 = '100010111100100001011110111111001'
ref10 = '110111001111111100100001000101100'
ref11 = '011100111010000101000111010001010'
ref12 = '011110000110001111110101100000011'
ref13 = '111111111111111000111001001011000'
ref14 = '111000010111010011010011010100100'
ref15 = '101010100010110010110101010000010'
ref16 = '101100000101010001111101000000000'
ref17 = '000010100011001101000111101011010'
ref18 = '101001001111101111000101010001110'
ref19 = '101101111111000100100001110001000'
ref20 = '000010011000100110000011010000010'
ref21 = '001101101001101110010010011011000'
ref22 = '011101011010001000111101010100110'
ref23 = '111010100110011101001101000001110'
ref24 = '110001010010101111000101111111000'
ref25 = '001000111011100001010110111110000'
ref26 = '000000001110010110100010100010110'
ref27 = '111111101000101111000110101011010'
ref28 = '100000100111010101111100100011011'
ref29 = '101110101001010000101000111111000'
ref30 = '101110100011010010010111111011010'
ref31 = '101110100100011011110110101110000'
ref32 = '100000100110011001111100111100000'
ref33 = '111111101101000101001101110010001'

ref.append(ref1)
ref.append(ref2)
ref.append(ref3)
ref.append(ref4)
ref.append(ref5)
ref.append(ref6)
ref.append(ref7)
ref.append(ref8)
ref.append(ref9)
ref.append(ref10)
ref.append(ref11)
ref.append(ref12)
ref.append(ref13)
ref.append(ref14)
ref.append(ref15)
ref.append(ref16)
ref.append(ref17)
ref.append(ref18)
ref.append(ref19)
ref.append(ref20)
ref.append(ref21)
ref.append(ref22)
ref.append(ref23)
ref.append(ref24)
ref.append(ref25)
ref.append(ref26)
ref.append(ref27)
ref.append(ref28)
ref.append(ref29)
ref.append(ref30)
ref.append(ref31)
ref.append(ref32)
ref.append(ref33)


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

print(ref[x][y])


