You have nine coins and a balance scale. One of the coins is lighter than the others. Is it possible to identify it in only two weighings?

weegschaal

This is indeed possible by applying the following strategy. Number the coins from 1 to 9. Divide the coins in three groups: a group containing the first three coins 1-2-3, a group containing the coins 4-5-6 and a group containing the coins 7-8-9. Put the group 1-2-3 to to the left of the balance scale and weigh it against the group 4-5-6 that you put to the right of the balance scale. If they don't balance, then the counterfeit coin is in the lighter group. If they do balance, then it's among the three coins in the unweighed group.

Having narrowed the field to a group of three suspect coins, we can apply the same principle in the second weighing. Put the first coin of the suspect group to the left of the balance scale and weigh it against the second coin of the suspect group. If they don't balance, the lighter coin is counterfeit, and if they do, the third coin of the suspect group must be lighter.

Input

Two lines that describe the position of the balance scale upon respectively the first and the second weighing, if the above strategy is applied. If the balance scale is in equilibrium, the position is described by the term balance. Otherwise the position of the balance scale is described by the side of the scale that is lowest: left or right.

Output

The text coin #n is counterfeit, where n has to be filled up with the number of the counterfeit coin.

Example

Input:

left
balance

Output:

coin #6 is counterfeit

Epilogue

J.E. Littlewood observes that a similar puzzle wasted 10.000 scientist-hours of work during World War II.

There was even a proposal to drop it over Germany.

Resources