Prisoner

This reminds divination solitaire unfolding, and the ultimate goal of his answer make a wish - it will come true or not. For divination take a deck of 36 cards and thoroughly shuffle it, make a wish. Then remove the top card from the deck and put it in the clear on the table, and then remove the second card and put side by side, so that the deck of cards laid out in a row one after the other, and between putting some cards you need to comply with the rule. If the pickup two cards of the same suit are side by side, the right side is shifted to the left. If two cards of the same suit or value lie through the card, the right of the pair is shifted to the left card. If any of the cards again for the card is the same suit and two cards of the same suit or value lie again through the map, you need to make a new relaying similar cards. It is necessary to shift the cards that lie beneath the card to shift. Consider the unfolding of divination by the example, below. For example, the first card 6 were as follows.

Prisoner

As can be seen from the figure, which is higher than the third and fourth card of the same suit, so we put on the king of clubs queen of clubs.

Now the second and the fourth card of the same suit, shifting the jack of spades in the top ten of spades.

Now the fourth card of the same suit with the second card, so we shift to the king of spades jack of spades.

In this situation, it is already impossible to pass any map, so we spread out the deck next card.

As a result of the rearrangements of cards, it is necessary that cards were collected in a pile. If at one time unfolding the deck this could not be done, then the deck is going to thoroughly shuffled and expanded again. If the second time failed to collect cards in one deck, the cards are laid out for the third time, which is the last. If 3 times failed at least once to collect the cards in the deck, you make a wish come true, otherwise not.