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

Solution:
def f(a,b):
 if a<2:return((b^(b>>1))&1),b/2
 q=2**(2*a-2)
 Q=2**(a-1)
 if b<q:return f(a-1,b)
 x,y=f(a-1,b%q)
 if b<3*q:
	x,y=f(a-1,b%q)
	if b>=2*q:x+=Q;y+=Q
	elif a&1:y+=Q
	else:x+=Q
	return y,x
 if a&1:return-x+Q-1,-y+2*Q-1
 return-x+2*Q-1,-y+Q-1
a,b=map(int,raw_input().split())
x,y=f(a,b)[::(-1)**(a&1)]
print x,y