Secret formula

Take the deck of cards and select 9 cards of the same suit, for example, the peak cards: ace, 2, 3, 4, 5, 6, 7, 8, 9. Ask the three spectators to remember one card. After that, ask each viewer to make certain calculations with the values ​​of the cards. The first viewer should multiply his card by 2, add 1 to the value obtained and multiply it by 5 again. Suppose that the value of A is obtained. The second viewer should add the value of A to the value of his card, multiply the result by 2, add 1 And the newly obtained value is multiplied by 5. Suppose that the value of B is obtained. The third viewer should add to the value of his card to B, multiply the result by 2, add 1 to the value obtained and multiply the result by 5. After that, you get the result from Which needs to be subtracted from the five fives of 555, if there are two spectators, then you need to subtract two fives 55. The first 3 numbers of the resulting number correspond to the cards that the viewers chose.


Example

The first spectator chose a deuce, the second spectator chose a four, and the third viewer chose the top three.

The first calculation: 2 * 2 = 4 + 1 = 5 * 5 = 25.
The second calculation: 25 + 4 = 29 * 2 = 58 + 1 = 59 + 5 = 295.
The third calculation: 295 + 3 = 298 * 2 = 596 + 1 = 597 * 5 = 2985.

The final calculation: 2985-555 = 2430.
On the final result we get that the first spectator chose the deuce, the second viewer chose the four, the third viewer chose the top three.