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(n,m):
    if n==0:
        return 0,0
    size = 1<<(n-1)
    quadrant, base = divmod(m, size*size)
    y,x = f(n-1, base)
    if quadrant==0:
        return x,y
    elif quadrant==1:
        return y,size+x
    elif quadrant==2:
        return size+y, size+x
    else:
        return 2*size-(x+1), size-(y+1)

n,m = map(int, str(raw_input()).split())
for i in f(n,m):
    print i,