eolymp
bolt
Try our new interface for solving problems
Problems

Bit automaton

Bit automaton

Ralph found a new weapon - a bit machine! This automaton fires bursts of bits, with the first bit fired dealing 1 damage to the target, and each successive bit dealing twice as much damage to the target as the previous one.

This machine came in handy when Ralph was suddenly attacked by a horde of cyber-bugs. While shooting at the bug, Ralph notices which bits hit the target and which didn't. Unfortunately, over the years of hard work, our hero has pretty much ruined his eyesight, and therefore he can recognize the trajectory of one of the bits incorrectly. In this regard, the actual and noticed by Ralph damage may differ. Knowing the number of bits fired and the estimated damage, help Ralph find out what the minimum and maximum real damage could be inflicted on the cyberbug.

Input

The first line contains two numbers n and a (1n63, 0a2 ^n - 1) - the number of bits in the code and the expected damage, respectively.

Output

Print two numbers: the minimum and maximum possible real damage, given that Ralph could make a mistake in recognizing the result of a shot in no more than one bit. It is known that 0aminamax2n - 1.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3 5
Output example #1
1 7
Input example #2
5 0
Output example #2
0 16
Source 2018 Цикл Интернет-олимпиад для школьников, вторая командная олимпиада сезона, базовая номинация, November 10, Problem C