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 PYTHON3):

Solution:
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))