Mahsa has been practicing shuffling cards for a few months now. Tonight, she finally decided to invite her friends over and show off her new skills. So she picks up a deck with cards, shows her friends the face of the cards without changing the deck order and asks someone to pick two positions and in the deck. Then, she tells everyone that she is going to move the card in the -th position to the -th position by applying only two types of shuffles.
Assume the cards in the deck are . Mahsa can perform these two shuffles as many times as she wants:
Riffle: Divide the cards into two parts and and produce .
Scuffle: From , produce .
Help Mahsa find out the minimum number of shuffles she needs, and she’ll figure out the rest.
The input consists of a single line containing three space-separated integers , and ( and ).
Print a single integer, the minimum number of shuffles required to bring the -th card to the -th position. If it is not possible to do so, print instead.