The Morton number of two integers x and y is the integer built by interleaving the bits of x and the bits of y one place at a time. The bits of x go to the even numbered places and the bits of y go to the odd numbered places, where places are counted upward from the least significant bit, which is the first place.
Write xi for the i-th bit of x and yi for the i-th bit of y, so that x=∑i=116xi2i−1 and the same holds for y. The Morton number M is then
M=∑i=116(xi22i−1+yi22i−2)
If x and y 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 x or y grows.
Given x and y in base 10, write a program that prints their Morton number in base 10.
The first line contains the integers x and y separated by whitespace. (0≤x,y≤216−1)
Print the Morton number of x and y on the first line.