[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

Source: codeforces | Difficulty: MEDIUM
Tags: Implementation


Solutions:
(a, b) = map(int, input().split())
b = str(b)
c = ''
for i in b:
	c = i + c
print(a + int(c))


def numbers(a, b):
	res = 0
	while b > 0:
		res = 10 * res + b % 10
		b //= 10
	return a + res
(A, B) = [int(i) for i in input().split()]
print(numbers(A, B))


(n, m) = map(str, input().split())
x = list(m)
x.reverse()
s = ''
for el in x:
	s += el
print(int(n) + int(s))


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


(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])


(a, b) = [int(x) for x in input().split()]
new = str(b)
rev = ''
for i in range(len(new)):
	rev += new[len(new) - i - 1]
print(int(rev) + a)


(n, m) = input().split()
s = ''
n = int(n)
for i in range(len(m) - 1, -1, -1):
	s += m[i]
s = int(s)
print(n + s)


(a, b) = map(str, input().split())
num = ''.join(reversed(b))
ans = int(a) + int(num)
print(ans)


a = input().split()
s = []
for i in a[1]:
	s.insert(0, i)
print(int(a[0]) + int(''.join(s)))


(x, y) = input().split()
print(int(x) + int(y[::-1]))


(a, b) = input().split()
a = int(a)
b = int(''.join(reversed(b)))
print(a + b)


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

def mysterSum(a=int(x), b=int(y[::-1])):
	mysum = a + b
	return mysum
out = mysterSum(a=int(x), b=int(y[::-1]))
print(out)


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])


(a, b) = input().split()
while len(a) != len(b):
	if len(a) < len(b):
		a = '0' + a
	if len(b) < len(a):
		b = b + '0'
c = ''
f = 1
d = 0
for i in range(len(a)):
	e = int(b[i]) + int(a[len(a) - i - 1])
	d = d + e * f
	f = f * 10
print(d)


a = input()
b = a.split()
c = ''
for i in range(1, len(b[1]) + 1):
	c += b[1][-i]
print(int(b[0]) + int(c))


3
(x, y) = tuple(map(int, input().split()))
qr = '111111101010101111100101001111111\n100000100000000001010110001000001\n101110100110110000011010001011101\n101110101011001001111101001011101\n101110101100011000111100101011101\n100000101010101011010000101000001\n111111101010101010101010101111111\n000000001111101111100111100000000\n100010111100100001011110111111001\n110111001111111100100001000101100\n011100111010000101000111010001010\n011110000110001111110101100000011\n111111111111111000111001001011000\n111000010111010011010011010100100\n101010100010110010110101010000010\n101100000101010001111101000000000\n000010100011001101000111101011010\n101001001111101111000101010001110\n101101111111000100100001110001000\n000010011000100110000011010000010\n001101101001101110010010011011000\n011101011010001000111101010100110\n111010100110011101001101000001110\n110001010010101111000101111111000\n001000111011100001010110111110000\n000000001110010110100010100010110\n111111101000101111000110101011010\n100000100111010101111100100011011\n101110101001010000101000111111000\n101110100011010010010111111011010\n101110100100011011110110101110000\n100000100110011001111100111100000\n111111101101000101001101110010001'.split()
print(qr[x][y])


grid = '111111101010101111100101001111111\n100000100000000001010110001000001\n101110100110110000011010001011101\n101110101011001001111101001011101\n101110101100011000111100101011101\n100000101010101011010000101000001\n111111101010101010101010101111111\n000000001111101111100111100000000\n100010111100100001011110111111001\n110111001111111100100001000101100\n011100111010000101000111010001010\n011110000110001111110101100000011\n111111111111111000111001001011000\n111000010111010011010011010100100\n101010100010110010110101010000010\n101100000101010001111101000000000\n000010100011001101000111101011010\n101001001111101111000101010001110\n101101111111000100100001110001000\n000010011000100110000011010000010\n001101101001101110010010011011000\n011101011010001000111101010100110\n111010100110011101001101000001110\n110001010010101111000101111111000\n001000111011100001010110111110000\n000000001110010110100010100010110\n111111101000101111000110101011010\n100000100111010101111100100011011\n101110101001010000101000111111000\n101110100011010010010111111011010\n101110100100011011110110101110000\n100000100110011001111100111100000\n111111101101000101001101110010001'.splitlines()
(i, j) = map(int, input().split())
print(grid[i][j])


import math
(a, b) = map(int, input().split())
c = str(b)
d = ''.join(reversed(c))
print(a + int(d))


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def reverse_number(n):
	r = 0
	while n > 0:
		r *= 10
		r += n % 10
		n //= 10
	return r
(m, s) = inlt()
print(m + reverse_number(s))


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()]

	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()


(a1, a2) = map(int, input().split())
print(a1 + int(''.join(list(str(a2))[::-1])))


s = list(input().split())
a = s[0]
b = s[1]
print(int(a) + int(b[::-1]))


def main():
	a = input().split(' ')
	print(int(a[0]) + int(a[1][::-1]))
main()


(n, m) = map(int, input().split())
print(n + int(str(m)[::-1]))


(a, b) = map(int, input().split(' '))
newb = 0
while b > 0:
	newb *= 10
	newb += b % 10
	b //= 10
print(a + newb)


(a1, a2) = map(int, input().split())
a2 = str(a2)
a2 = a2[::-1]
a2 = int(a2)
print(a1 + a2)


(A, B) = map(int, input().split())
B = str(B)
C = ''
for i in range(len(B) - 1, -1, -1):
	C += B[i]
C = int(C)
print(A + C)


(a, b) = input().split()
a = int(a)
b = int(b[::-1])
print(a + b)


import math
import re
from fractions import Fraction
from collections import Counter

class Task:
	(a, b) = (0, 0)
	answer = 0

	def __init__(self):
		(self.a, self.b) = [x for x in input().split()]

	def solve(self):
		(a, b) = (self.a, self.b)
		self.answer = int(a) + int(b[::-1])

	def printAnswer(self):
		print(self.answer)
task = Task()
task.solve()
task.printAnswer()


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from io import BytesIO, IOBase
from itertools import *
from collections import *
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solve(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solve(p * 10 + a, l + 1, a, b, n)
	solve(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def f(a, b):
	if b == 0:
		return (0, 0)
	(x, y) = f(a - 1, b % 4 ** (a - 1))
	if b < 4 ** (a - 1):
		return (y, x)
	if b < 2 * 4 ** (a - 1):
		return (x, y + 2 ** (a - 1))
	if b < 3 * 4 ** (a - 1):
		return (x + 2 ** (a - 1), y + 2 ** (a - 1))
	return (2 ** a - 1 - y, 2 ** (a - 1) - 1 - x)

def main():
	(a, b) = map(int, input().split())
	print(*f(a, b))
main()


__author__ = 'MARI'

def reverse(a):
	b = 0
	while a > 0:
		b *= 10
		b += a % 10
		a //= 10
	return b

def main():
	(a, b) = [int(x) for x in input().split()]
	print(a + reverse(b))
import sys
argv = sys.argv
main()


(x, y) = map(int, input().split())
dig0 = 0
y2 = 0
x2 = 0
orig_y = y
if 0 <= x <= 10 ** 9 and 0 <= y <= 10 ** 9:
	while y > 0:
		dig = y % 10
		y = y // 10
		dig0 += dig
		if dig0 > 0:
			y2 = y2 * 10 + dig
		else:
			pass
	print(x + y2)


s = [int(n) for n in input().split()]

def f(x):
	s = [int(n) for n in str(x)]
	m = 0
	for n in range(len(s)):
		m += s[n] * 10 ** n
	return m
print(s[0] + f(s[1]))


(a, b) = [int(x) for x in input().split()]
c = 0
while b > 0:
	c = c * 10 + b % 10
	b //= 10
print(a + c)


(a, b) = map(int, input().split())
c = b
k = m = 0
while c > 0:
	c = c // 10
	k += 1
for i in range(k, 0, -1):
	m += b % 10 * 10 ** (i - 1)
	b = b // 10
print(a + m)


(n, m) = input().split()
ln = len(n)
lm = len(m)
if ln > lm:
	m = m + '0' * (ln - lm)
else:
	n = '0' * (lm - ln) + n
ans = ['0'] * (len(n) + 1)
y1 = 0
for i in range(len(n)):
	x = str(int(m[i]) + int(n[len(n) - i - 1]) + int(ans[len(n) - i]))
	if len(x) == 1:
		ans[len(n) - i] = x
	else:
		ans[len(n) - i] = x[1]
		ans[len(n) - i - 1] = str(int(x[0]) + int(ans[len(n) - i - 1]))
a = ''
for i in range(len(ans)):
	a += ans[i]
print(int(a))


def readln():
	return tuple(map(int, input().split()))
(a, b) = readln()
print(a + int(''.join(reversed(list(str(b))))))


(a, b) = map(int, input().split())
a = str(a)
b = str(b)
b = b[::-1]
b.strip('0')
print(int(a) + int(b))


try:
	(a, b) = map(int, input().split())
	print(a + int(str(b)[::-1]))
except EOFError as e:
	print(e)


n = input()
m = n.split()[1]
n = n.split()[0]
(i, j) = (len(n), len(m))
k = max(i, j)
t = min(i, j)
s = 0
for i in range(k):
	if i < t:
		s += (int(n[-i - 1]) + int(m[i])) * 10 ** i
	elif len(n) > len(m):
		s += int(n[-i - 1]) * 10 ** i
	else:
		s += int(m[i]) * 10 ** i
print(s)


import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def sumc(t):
	s = 0
	while t > 0:
		s += t % 10
		t //= 10
	return s
a = li()
sa1 = list(str(a[1]))
sa1.reverse()
print(a[0] + int(''.join(sa1)))


(a, s) = map(int, input().split())
s = list(str(s))
s.reverse()
for i in range(len(s)):
	a += 10 ** i * int(s[-1 - i])
print(a)


(n1, n2) = map(int, input().split())
rev = 0
while n2 > 0:
	rem = n2 % 10
	rev = rev * 10 + rem
	n2 = n2 // 10
print(f'{n1 + rev}')


s = '111111101010101111100101001111111\n100000100000000001010110001000001\n101110100110110000011010001011101\n101110101011001001111101001011101\n101110101100011000111100101011101\n100000101010101011010000101000001\n111111101010101010101010101111111\n000000001111101111100111100000000\n100010111100100001011110111111001\n110111001111111100100001000101100\n011100111010000101000111010001010\n011110000110001111110101100000011\n111111111111111000111001001011000\n111000010111010011010011010100100\n101010100010110010110101010000010\n101100000101010001111101000000000\n000010100011001101000111101011010\n101001001111101111000101010001110\n101101111111000100100001110001000\n000010011000100110000011010000010\n001101101001101110010010011011000\n011101011010001000111101010100110\n111010100110011101001101000001110\n110001010010101111000101111111000\n001000111011100001010110111110000\n000000001110010110100010100010110\n111111101000101111000110101011010\n100000100111010101111100100011011\n101110101001010000101000111111000\n101110100011010010010111111011010\n101110100100011011110110101110000\n100000100110011001111100111100000\n111111101101000101001101110010001\n'.split()
(a, b) = map(int, input().split())
print(s[a][b])


(a, b) = input('').split()
c = b[::-1]
d = int(c)
e = int(a)
print(d + e)


(a, b) = [int(q) for q in 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[a][b])


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])


def f(a, b):
	if b == 0:
		return (0, 0)
	(x, y) = f(a - 1, b % 4 ** (a - 1))
	if b < 4 ** (a - 1):
		return (y, x)
	if b < 2 * 4 ** (a - 1):
		return (x, y + 2 ** (a - 1))
	if b < 3 * 4 ** (a - 1):
		return (x + 2 ** (a - 1), y + 2 ** (a - 1))
	return (2 ** a - 1 - y, 2 ** (a - 1) - 1 - x)
(a, b) = [int(x) for x in input().split()]
(a, b) = f(a, b)
print(int(a), int(b))


(n1, n2) = map(int, input().split())
print(n1 + int(str(n2)[::-1]))


replacements = {'A': '+BF-AFA-FB+', 'B': '-AF+BFB+FA-', '+': '+', '-': '-', 'F': 'F'}

def curve_sequence(n):
	if n == 0:
		yield 'A'
		return
	for t in curve_sequence(n - 1):
		yield from replacements[t]
(a, b) = map(int, input().split())

def location(a, b):
	i = 0
	(x, y) = (0, 0)
	direction = 0
	for move in curve_sequence(a):
		if i == b:
			return (x, y)
		if move == '+':
			direction += 1
			direction %= 4
		elif move == '-':
			direction -= 1
			direction %= 4
		if move != 'F':
			continue
		i += 1
		if direction == 0:
			x += 1
		elif direction == 1:
			y += 1
		elif direction == 2:
			x -= 1
		else:
			y -= 1
print(*location(a, b))


binary = ['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 = [int(i) for i in input().split()]
y = x[0]
z = x[1]
print(int(binary[y][z]))


(a, b) = (i for i in input().split())
b = b[::-1]
a = int(a)
b = int(b)
print(a + b)


inp = list(map(int, input().split()))
a = inp[0]
b = inp[1]
b = str(b)
n = ''
for i in range(len(b) - 1, -1, -1):
	n = n + b[i]
n = int(n)
print(a + n)


(a, b) = input().split()
z = int(b[::-1])
x = int(a)
print(z + x)


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


(n, k) = input().split()
print(int(n) + int(''.join(reversed(k))))


(a, b) = input().split()
(a, b) = (int(a), int(b))
temp = 0
digit = 0
while b:
	digit = b % 10
	temp = temp * 10 + digit
	b //= 10
b = temp
print(a + b)


import sys
input = lambda : sys.stdin.readline().rstrip()
(a, b) = map(int, input().split())
print(a + int(str(b)[::-1]))


(n, m) = input().split()
print(int(n) + int(m[::-1]))


from math import floor
(x, y) = input().split()
x = int(x)
y = int(y)
rev = 0
while y > 0:
	a = int(y % 10)
	rev = rev * 10 + a
	y = floor(y / 10)
b = x + rev
print(b)


(a, b) = map(int, input().split())
b = list(str(b))
b.reverse()
b = int(''.join(b))
print(a + b)


(a, b) = map(str, input().split())
n = int(a)
k = int(b[::-1])
print(n + k)


l = (1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 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0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1)
(x, y) = map(int, input().split())
print(l[x * 33 + y])


(n, m) = map(int, input().split())
x = str(m)
y = int(x[::-1])
print(n + y)


s = input().split()
print(int(s[0]) + int(s[1][::-1]))


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])


(n, m) = input().split()
n = int(n)
m = int(m)
res = 0
while m > 0:
	res = res * 10 + m % 10
	m = int(m / 10)
print(res + n)


def coords(d, n):
	(x, y) = (0, 0)
	for i in range(n):
		sect = 2 ** i
		sx = d >> 1 & 1
		sy = (d ^ sx) & 1
		(x, y) = rotate(x, y, sx, sy, sect)
		x += sect * sx
		y += sect * sy
		d //= 4
	return (x, y)

def rotate(x, y, sx, sy, n):
	if sy == 0:
		if sx == 1:
			(x, y) = (n - 1 - x, n - 1 - y)
		(x, y) = (y, x)
	return (x, y)
(n, d) = map(int, input().split())
print(*coords(d, n))


qr = '111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001'

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


s = '111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001'
a = [int(i) for i in input().split(' ')]
print(s[33 * a[0] + a[1]])


(a, b) = map(int, input().split())
rev = 0
while b > 0:
	rev = 10 * rev + b % 10
	b = b // 10
print(a + rev)


a = input()
a = a.split()
d = []
for i in a:
	d.append(str(i))
b = d[0]
c = d[1][::-1]
b = int(b)
c = int(c)
e = str(b + c)
print(e)


def read():
	(x, y) = map(int, input().split())
	return (x, y)

def solve(x, y):
	y1 = 0
	while y != 0:
		y1 = y1 * 10 + y % 10
		y //= 10
	return x + y1
print(solve(*read()))


(a, b) = [x for x in input().split()]
print(int(a) + int(b[::-1]))


(a, b) = input().split()
b = list(b)
b.reverse()
b = int(''.join(b))
print(int(a) + b)


(a1, a2) = input().split()
print(int(a1) + int(a2[::-1]))


(x, y) = [int(x) for x in input().split()]
print(__doc__[34 * x + y])


(a, b) = map(int, input().split())
print('%d' % (a + int(str(b)[::-1])))


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])


(a, b) = map(int, input().split())
result = a + int(str(b)[::-1])
print(result)


[N1, N2] = map(int, input().split())
N2 = int(str(N2)[::-1])
print(N1 + N2)


(x, y) = map(int, input().split())
print(x + int(str(y)[::-1]))


(a, b) = map(int, input().split())
bx = 0
while b > 0:
	bx = bx * 10 + b % 10
	b //= 10
print(a + bx)


a = input()
print(int(a.split()[0]) + int(a.split()[1][::-1]))


(a, b) = input().split()
n = max(len(a), len(b))
a = ('0' * n + a)[-n:]
b = (b + '0' * n)[:n]
ans = []
carry = 0
for (j, i) in zip(b, reversed(a)):
	x = int(i) + int(j) + carry
	carry = x // 10
	ans.append(str(x % 10))
ans.append(str(carry))
print(int(''.join(reversed(ans))))


from math import gcd, sqrt, ceil

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def si():
	return input()

def main():
	(a, b) = mi()
	s = list(str(b))
	s.reverse()
	s = ''.join(s)
	print(a + int(s))
main()


ls = list(map(str, input().split()))
ls[1] = ls[1][::-1]
print(int(ls[0]) + int(ls[1]))


(n, m) = input().split()
m = str.join('', reversed(m))
print(int(n) + int(m))


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


num = input().split()
print(int(num[0]) + int(num[1][::-1]))


n = input().split()
c1 = int(n[0])
n1 = ''
for i in range(len(n[1]) - 1, -1, -1):
	n1 += n[1][i]
c2 = int(n1)
print(c1 + c2)


(a, b) = map(int, input().split())
c = str(b)
for i in range(len(c) - 1, -1, -1):
	a += 10 ** i * int(c[i])
print(a)


def mysterious_numbers(x, y):
	result = 0
	z = int(y)
	while z > 0:
		result = result * 10 + z % 10
		z = z // 10
	return int(x) + result
(x, y) = input().split()
print(mysterious_numbers(x, y))


(a, b) = [int(x) for x in input().split()]
ch2 = str(b)
res = a + int(''.join(reversed(list(ch2))))
print(res)


(a, b) = map(int, input().split())
b = str(b)[::-1]
c = a + int(b)
print(c)


(a, b) = (int(t) for t in input().split(' '))
b = int(str(b)[::-1])
print(a + b)


qr = '111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001'
(n, m) = map(int, input().strip().split())
print(qr[n * 33 + m])