Morton Numbers

No attempts yetTime limit2sMemory limit512 MB

Problem

The Morton number of two integers xx and yy is the integer built by interleaving the bits of xx and the bits of yy one place at a time. The bits of xx go to the even numbered places and the bits of yy go to the odd numbered places, where places are counted upward from the least significant bit, which is the first place.

Write xix_i for the ii-th bit of xx and yiy_i for the ii-th bit of yy, so that x=i=116xi2i1x = \sum_{i=1}^{16} x_i 2^{i-1} and the same holds for yy. The Morton number MM is then

M=i=116(xi22i1+yi22i2)M = \sum_{i=1}^{16} \left( x_i \, 2^{2i-1} + y_i \, 2^{2i-2} \right)

If xx and yy are read as the coordinates of a point in the plane, two points that lie close together have Morton numbers that lie close together as well. The Morton number also grows when xx or yy grows.

Given xx and yy in base 10, write a program that prints their Morton number in base 10.

Input

The first line contains the integers xx and yy separated by whitespace. (0x,y21610 \le x, y \le 2^{16} - 1)

Output

Print the Morton number of xx and yy on the first line.