During research dedicated to the emergence of life on the planet Olympia, scientists made several sensational discoveries:
All living organisms on the planet originated from a single bacterium Bitozoria Programulis.
Evolution proceeded step by step (according to scientists' hypothesis, during periods of climate change on the planet).
At each step of evolution, exactly two subspecies formed from each existing species, and the original species disappeared.
If the appearance of the bacterium Bitozoria Programulis is considered the first step of evolution, then currently existing living organisms are at the -th step.

To avoid creating names during the research, scientists assigned numbers to every species that ever existed on the planet. They constructed an evolutionary tree with the root Bitozoria Programulis, which was assigned the number . Then, for each evolutionary step, they numbered the species from left to right. Thus, the direct subspecies of Bitozoria Programulis were assigned numbers and . Next, the species of the third evolutionary step were numbered—the subspecies of species received numbers and , and those of species received numbers and , and so on.
Write a program that, given the numbers of two species, calculates the number of their closest common ancestor in the evolutionary tree.
The first line contains the number of evolutionary stages (1 \leq n \leq 100) that have occurred on the planet Olympia up to now. The second and third lines each contain a positive integer representing the numbers of the species for which the closest common ancestor needs to be found.
Output one positive integer—the number assigned to the closest common ancestor of the two species.
Example 1
Example 2