[Image] 


-----Input-----

The input contains two integers a_1, a_2 (0 ≤ a_{i} ≤ 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

Difficulty: interview

Starter code:

Solutions:
import math
import re
from fractions import Fraction

class Task:
    table = ['111111101010101111100101001111111\n', '100000100000000001010110001000001\n', '101110100110110000011010001011101\n', '101110101011001001111101001011101\n', '101110101100011000111100101011101\n', '100000101010101011010000101000001\n', '111111101010101010101010101111111\n', '000000001111101111100111100000000\n', '100010111100100001011110111111001\n', '110111001111111100100001000101100\n', '011100111010000101000111010001010\n', '011110000110001111110101100000011\n', '111111111111111000111001001011000\n', '111000010111010011010011010100100\n', '101010100010110010110101010000010\n', '101100000101010001111101000000000\n', '000010100011001101000111101011010\n', '101001001111101111000101010001110\n', '101101111111000100100001110001000\n', '000010011000100110000011010000010\n', '001101101001101110010010011011000\n', '011101011010001000111101010100110\n', '111010100110011101001101000001110\n', '110001010010101111000101111111000\n', '001000111011100001010110111110000\n', '000000001110010110100010100010110\n', '111111101000101111000110101011010\n', '100000100111010101111100100011011\n', '101110101001010000101000111111000\n', '101110100011010010010111111011010\n', '101110100100011011110110101110000\n', '100000100110011001111100111100000\n', '111111101101000101001101110010001\n']

    x, y = 0, 0 
    answer = 0
    
    def __init__(self):
        self.x, self.y = [int(_) for _ in input().split()]
        #inFile = open('input.txt', 'r')
        #self.table = inFile.readlines()

    def solve(self):
        table, x, y = self.table, self.x, self.y
        self.answer = table[x][y]

    def printAnswer(self):
        print(self.answer)

task = Task()
task.solve()
task.printAnswer()


3

x, y = tuple(map(int, input().split()))
qr = '''111111101010101111100101001111111
100000100000000001010110001000001
101110100110110000011010001011101
101110101011001001111101001011101
101110101100011000111100101011101
100000101010101011010000101000001
111111101010101010101010101111111
000000001111101111100111100000000
100010111100100001011110111111001
110111001111111100100001000101100
011100111010000101000111010001010
011110000110001111110101100000011
111111111111111000111001001011000
111000010111010011010011010100100
101010100010110010110101010000010
101100000101010001111101000000000
000010100011001101000111101011010
101001001111101111000101010001110
101101111111000100100001110001000
000010011000100110000011010000010
001101101001101110010010011011000
011101011010001000111101010100110
111010100110011101001101000001110
110001010010101111000101111111000
001000111011100001010110111110000
000000001110010110100010100010110
111111101000101111000110101011010
100000100111010101111100100011011
101110101001010000101000111111000
101110100011010010010111111011010
101110100100011011110110101110000
100000100110011001111100111100000
111111101101000101001101110010001'''.split()
print(qr[x][y])


t = '111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001'
x, y = map(int, input().split())
print(t[y + 33 * x])

qr_code = ["111111101010101111100101001111111", "100000100000000001010110001000001", "101110100110110000011010001011101", "101110101011001001111101001011101", "101110101100011000111100101011101", "100000101010101011010000101000001", "111111101010101010101010101111111", "000000001111101111100111100000000", "100010111100100001011110111111001", "110111001111111100100001000101100", "011100111010000101000111010001010", "011110000110001111110101100000011", "111111111111111000111001001011000", "111000010111010011010011010100100", "101010100010110010110101010000010", "101100000101010001111101000000000", "000010100011001101000111101011010", "101001001111101111000101010001110", "101101111111000100100001110001000", "000010011000100110000011010000010", "001101101001101110010010011011000", "011101011010001000111101010100110", "111010100110011101001101000001110", "110001010010101111000101111111000", "001000111011100001010110111110000", "000000001110010110100010100010110", "111111101000101111000110101011010", "100000100111010101111100100011011", "101110101001010000101000111111000", "101110100011010010010111111011010", "101110100100011011110110101110000", "100000100110011001111100111100000", "111111101101000101001101110010001"]
x, y = [int(x) for x in input().split(" ")]
print(qr_code[x][y])


import sys
import math

st = list("111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001")

k = []
i = 0
while(i < 32 * 32 + 33):
    k.append(st[i: i + 33])
    i += 33

a1, a2 = list(map(int, input().split()))
print(k[a1][a2])


ans=['']*33
ans[0]='111111101010101111100101001111111'
ans[1]='100000100000000001010110001000001'
ans[2]='101110100110110000011010001011101'
ans[3]='101110101011001001111101001011101'
ans[4]='101110101100011000111100101011101'
ans[5]='100000101010101011010000101000001'
ans[6]='111111101010101010101010101111111'
ans[7]='000000001111101111100111100000000'
ans[8]='100010111100100001011110111111001'
ans[9]='110111001111111100100001000101100'
ans[10]='011100111010000101000111010001010'
ans[11]='011110000110001111110101100000011'
ans[12]='111111111111111000111001001011000'
ans[13]='111000010111010011010011010100100'
ans[14]='101010100010110010110101010000010'
ans[15]='101100000101010001111101000000000'
ans[16]='000010100011001101000111101011010'
ans[17]='101001001111101111000101010001110'
ans[18]='101101111111000100100001110001000'
ans[19]='000010011000100110000011010000010'
ans[20]='001101101001101110010010011011000'
ans[21]='011101011010001000111101010100110'
ans[22]='111010100110011101001101000001110'
ans[23]='110001010010101111000101111111000'
ans[24]='001000111011100001010110111110000'
ans[25]='000000001110010110100010100010110'
ans[26]='111111101000101111000110101011010'
ans[27]='100000100111010101111100100011011'
ans[28]='101110101001010000101000111111000'
ans[29]='101110100011010010010111111011010'
ans[30]='101110100100011011110110101110000'
ans[31]='100000100110011001111100111100000'
ans[32]='111111101101000101001101110010001'
a,b=list(map(int,input().split()))
print(ans[a][b])


a = ['111111101010101111100101001111111',
'100000100000000001010110001000001',
'101110100110110000011010001011101',
'101110101011001001111101001011101',
'101110101100011000111100101011101',
'100000101010101011010000101000001',
'111111101010101010101010101111111',
'000000001111101111100111100000000',
'100010111100100001011110111111001',
'110111001111111100100001000101100',
'011100111010000101000111010001010',
'011110000110001111110101100000011',
'111111111111111000111001001011000',
'111000010111010011010011010100100',
'101010100010110010110101010000010',
'101100000101010001111101000000000',
'000010100011001101000111101011010',
'101001001111101111000101010001110',
'101101111111000100100001110001000',
'000010011000100110000011010000010',
'001101101001101110010010011011000',
'011101011010001000111101010100110',
'111010100110011101001101000001110',
'110001010010101111000101111111000',
'001000111011100001010110111110000',
'000000001110010110100010100010110',
'111111101000101111000110101011010',
'100000100111010101111100100011011',
'101110101001010000101000111111000',
'101110100011010010010111111011010',
'101110100100011011110110101110000',
'100000100110011001111100111100000',
'111111101101000101001101110010001']
a1, a2 = map(int, input().split())
print(a[a1][a2])

S=str.split
a,b=map(int,S(input()))
print(S('111111101010101111100101001111111 100000100000000001010110001000001 101110100110110000011010001011101 101110101011001001111101001011101 101110101100011000111100101011101 100000101010101011010000101000001 111111101010101010101010101111111 000000001111101111100111100000000 100010111100100001011110111111001 110111001111111100100001000101100 011100111010000101000111010001010 011110000110001111110101100000011 111111111111111000111001001011000 111000010111010011010011010100100 101010100010110010110101010000010 101100000101010001111101000000000 000010100011001101000111101011010 101001001111101111000101010001110 101101111111000100100001110001000 000010011000100110000011010000010 001101101001101110010010011011000 011101011010001000111101010100110 111010100110011101001101000001110 110001010010101111000101111111000 001000111011100001010110111110000 000000001110010110100010100010110 111111101000101111000110101011010 100000100111010101111100100011011 101110101001010000101000111111000 101110100011010010010111111011010 101110100100011011110110101110000 100000100110011001111100111100000 111111101101000101001101110010001')[a][b])

arr = ["111111101010101111100101001111111", "100000100000000001010110001000001", "101110100110110000011010001011101", "101110101011001001111101001011101", "101110101100011000111100101011101", "100000101010101011010000101000001", "111111101010101010101010101111111", "000000001111101111100111100000000", "100010111100100001011110111111001", "110111001111111100100001000101100", "011100111010000101000111010001010", "011110000110001111110101100000011", "111111111111111000111001001011000", "111000010111010011010011010100100", "101010100010110010110101010000010", "101100000101010001111101000000000", "000010100011001101000111101011010", "101001001111101111000101010001110", "101101111111000100100001110001000", "000010011000100110000011010000010", "001101101001101110010010011011000", "011101011010001000111101010100110", "111010100110011101001101000001110", "110001010010101111000101111111000", "001000111011100001010110111110000", "000000001110010110100010100010110", "111111101000101111000110101011010", "100000100111010101111100100011011", "101110101001010000101000111111000", "101110100011010010010111111011010", "101110100100011011110110101110000", "100000100110011001111100111100000", "111111101101000101001101110010001"]
a, b = map(int, input().split())
print(arr[a][b])

a,b = list(map(int,input().split(" "))), ["111111101010101111100101001111111","100000100000000001010110001000001","101110100110110000011010001011101","101110101011001001111101001011101","101110101100011000111100101011101","100000101010101011010000101000001","111111101010101010101010101111111","000000001111101111100111100000000","100010111100100001011110111111001","110111001111111100100001000101100","011100111010000101000111010001010","011110000110001111110101100000011","111111111111111000111001001011000","111000010111010011010011010100100","101010100010110010110101010000010","101100000101010001111101000000000","000010100011001101000111101011010","101001001111101111000101010001110","101101111111000100100001110001000","000010011000100110000011010000010","001101101001101110010010011011000","011101011010001000111101010100110","111010100110011101001101000001110","110001010010101111000101111111000","001000111011100001010110111110000","000000001110010110100010100010110","111111101000101111000110101011010","100000100111010101111100100011011","101110101001010000101000111111000","101110100011010010010111111011010","101110100100011011110110101110000","100000100110011001111100111100000","111111101101000101001101110010001"]
print(b[a[0]][a[1]])

S=str.split

a,b=list(map(int,S(input())))

print(S('111111101010101111100101001111111 100000100000000001010110001000001 101110100110110000011010001011101 101110101011001001111101001011101 101110101100011000111100101011101 100000101010101011010000101000001 111111101010101010101010101111111 000000001111101111100111100000000 100010111100100001011110111111001 110111001111111100100001000101100 011100111010000101000111010001010 011110000110001111110101100000011 111111111111111000111001001011000 111000010111010011010011010100100 101010100010110010110101010000010 101100000101010001111101000000000 000010100011001101000111101011010 101001001111101111000101010001110 101101111111000100100001110001000 000010011000100110000011010000010 001101101001101110010010011011000 011101011010001000111101010100110 111010100110011101001101000001110 110001010010101111000101111111000 001000111011100001010110111110000 000000001110010110100010100010110 111111101000101111000110101011010 100000100111010101111100100011011 101110101001010000101000111111000 101110100011010010010111111011010 101110100100011011110110101110000 100000100110011001111100111100000 111111101101000101001101110010001')[a][b])



# Made By Mostafa_Khaled


x,y=map(int,input().split())
s=['111111101010101111100101001111111',
'100000100000000001010110001000001',
'101110100110110000011010001011101',
'101110101011001001111101001011101',
'101110101100011000111100101011101',
'100000101010101011010000101000001',
'111111101010101010101010101111111',
'000000001111101111100111100000000',
'100010111100100001011110111111001',
'110111001111111100100001000101100',
'011100111010000101000111010001010',
'011110000110001111110101100000011',
'111111111111111000111001001011000',
'111000010111010011010011010100100',
'101010100010110010110101010000010',
'101100000101010001111101000000000',
'000010100011001101000111101011010',
'101001001111101111000101010001110',
'101101111111000100100001110001000',
'000010011000100110000011010000010',
'001101101001101110010010011011000',
'011101011010001000111101010100110',
'111010100110011101001101000001110',
'110001010010101111000101111111000',
'001000111011100001010110111110000',
'000000001110010110100010100010110',
'111111101000101111000110101011010',
'100000100111010101111100100011011',
'101110101001010000101000111111000',
'101110100011010010010111111011010',
'101110100100011011110110101110000',
'100000100110011001111100111100000',
'111111101101000101001101110010001']
print(s[x][y])

lol = ['111111101010101111100101001111111\n', '100000100000000001010110001000001\n', '101110100110110000011010001011101\n', '101110101011001001111101001011101\n', '101110101100011000111100101011101\n', '100000101010101011010000101000001\n', '111111101010101010101010101111111\n', '000000001111101111100111100000000\n', '100010111100100001011110111111001\n', '110111001111111100100001000101100\n', '011100111010000101000111010001010\n', '011110000110001111110101100000011\n', '111111111111111000111001001011000\n', '111000010111010011010011010100100\n', '101010100010110010110101010000010\n', '101100000101010001111101000000000\n', '000010100011001101000111101011010\n', '101001001111101111000101010001110\n', '101101111111000100100001110001000\n', '000010011000100110000011010000010\n', '001101101001101110010010011011000\n', '011101011010001000111101010100110\n', '111010100110011101001101000001110\n', '110001010010101111000101111111000\n', '001000111011100001010110111110000\n', '000000001110010110100010100010110\n', '111111101000101111000110101011010\n', '100000100111010101111100100011011\n', '101110101001010000101000111111000\n', '101110100011010010010111111011010\n', '101110100100011011110110101110000\n', '100000100110011001111100111100000\n', '111111101101000101001101110010001']
a1, a2 = map(int, input().split())
print(lol[a1][a2])

t = '111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001'
x, y = map(int, input().split())
print(t[y + 33 * x])

s=str(input()).split()
a=list(map(int,s))
x=list('111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001')
print(x[a[0]*33 + a[1]])


s = [["111111101010101111100101001111111"],["100000100000000001010110001000001"],["101110100110110000011010001011101"],["101110101011001001111101001011101"],["101110101100011000111100101011101"],["100000101010101011010000101000001"],["111111101010101010101010101111111"],["000000001111101111100111100000000"],["100010111100100001011110111111001"],["110111001111111100100001000101100"],["011100111010000101000111010001010"],["011110000110001111110101100000011"],["111111111111111000111001001011000"],["111000010111010011010011010100100"],["101010100010110010110101010000010"],["101100000101010001111101000000000"],["000010100011001101000111101011010"],["101001001111101111000101010001110"],["101101111111000100100001110001000"],["000010011000100110000011010000010"],["001101101001101110010010011011000"],["011101011010001000111101010100110"],["111010100110011101001101000001110"],["110001010010101111000101111111000"],["001000111011100001010110111110000"],["000000001110010110100010100010110"],["111111101000101111000110101011010"],["100000100111010101111100100011011"],["101110101001010000101000111111000"],["101110100011010010010111111011010"],["101110100100011011110110101110000"],["100000100110011001111100111100000"],["111111101101000101001101110010001"]]
a1, a2 = map(int , input().split())
print(s[a1][0][a2])

ans = [["111111101010101111100101001111111"],["100000100000000001010110001000001"],["101110100110110000011010001011101"],["101110101011001001111101001011101"],["101110101100011000111100101011101"],["100000101010101011010000101000001"],["111111101010101010101010101111111"],["000000001111101111100111100000000"],["100010111100100001011110111111001"],["110111001111111100100001000101100"],["011100111010000101000111010001010"],["011110000110001111110101100000011"],["111111111111111000111001001011000"],["111000010111010011010011010100100"],["101010100010110010110101010000010"],["101100000101010001111101000000000"],["000010100011001101000111101011010"],["101001001111101111000101010001110"],["101101111111000100100001110001000"],["000010011000100110000011010000010"],["001101101001101110010010011011000"],["011101011010001000111101010100110"],["111010100110011101001101000001110"],["110001010010101111000101111111000"],["001000111011100001010110111110000"],["000000001110010110100010100010110"],["111111101000101111000110101011010"],["100000100111010101111100100011011"],["101110101001010000101000111111000"],["101110100011010010010111111011010"],["101110100100011011110110101110000"],["100000100110011001111100111100000"],["111111101101000101001101110010001"]];x,y = map(int,input().split());print(ans[x][0][y])

#author: riyan

qr = '111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001'

def __starting_point():
    n, m = map(int, input().strip().split())
    print(qr[(n * 33) + m])
__starting_point()

k=[ "111111101010101111100101001111111",
    "100000100000000001010110001000001",
    "101110100110110000011010001011101",
    "101110101011001001111101001011101",
    "101110101100011000111100101011101",
    "100000101010101011010000101000001",
    "111111101010101010101010101111111",
    "000000001111101111100111100000000",
    "100010111100100001011110111111001",
    "110111001111111100100001000101100",
    "011100111010000101000111010001010",
    "011110000110001111110101100000011",
    "111111111111111000111001001011000",
    "111000010111010011010011010100100",
    "101010100010110010110101010000010",
    "101100000101010001111101000000000",
    "000010100011001101000111101011010",
    "101001001111101111000101010001110",
    "101101111111000100100001110001000",
    "000010011000100110000011010000010",
    "001101101001101110010010011011000",
    "011101011010001000111101010100110",
    "111010100110011101001101000001110",
    "110001010010101111000101111111000",
    "001000111011100001010110111110000",
    "000000001110010110100010100010110",
    "111111101000101111000110101011010",
    "100000100111010101111100100011011",
    "101110101001010000101000111111000",
    "101110100011010010010111111011010",
    "101110100100011011110110101110000",
    "100000100110011001111100111100000",
    "111111101101000101001101110010001"]
x,y=list(map(int,input().split()))
print(k[x][y])


s="111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001";
a,b=list(map(int,input().split()))
print(s[33*a+b])