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:
__author__ = 'asmn'
def gao(n,m):
    if n==0:
        return (0,0)
    else:
        div=2**(2*n-2)
        l=2**(n-1)
        dx,dy=gao(n-1,m%div)
        if m/div==0:
            return dy,dx
        elif m/div==1:
            return dx,dy+l
        elif m/div==2:
            return dx+l,dy+l
        else:
            return  2*l-1-dy,l-1-dx
n,m=map(int,raw_input().split())
print '%d %d'%gao(n,m)