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:
import sys

def h(a, b):
    # print a, b
    if a == 0:
        return (0, 0)
    size = 1 << a
    quad, bb = divmod(b, size * size / 4)
    x, y = h(a - 1, bb)
    xx, yy = {
        0: (x, y),
        1: (y, size/2 + x),
        2: (size/2 + y, size/2 + x),
        3: (size - 1 - x, size/2 - 1 - y)
    }[quad]
    return yy, xx

a, b = [int(s) for s in sys.stdin.readline().split()]
x, y = h(a, b)
x, y = y, x
print x, y