You have nine coins and a scale. One of the coins is lighter than the others. Is it possible to identify the counterfeit coin by weighing only twice?

scale
You have nine coins and a scale. One of the coins is lighter than the others. Is it possible to identify the counterfeit coin by weighing only twice?

Indeed, you can do so by applying the following strategy. Number the coins from 1 to 9. Divide the coins in three groups: a group with the first three coins 1-2-3, a group with coins 4-5-6 and a group with coins 7-8-9. Place the group 1-2-3 on the left side of the scale and weigh it against the group 4-5-6 which you place on the right side of the scale. If the scale is balanced, then the counterfeit coin is in the group that was not weighed. Otherwise, the counterfeit coin is in the lightest group.

Now that the search space has been narrowed down to a group of three suspect coins, we can apply the same principle in a second weighing. Place the first coin from the suspect group on the left side of the scale, and weigh it against the second coin from the suspect group. If the scale is not balanced, then the counterfeit coin is the lighter of the two coins weighed. Otherwise, the third coin of the suspect group is counterfeit.

Input

Two lines indicating the position of the scale at first and second weighing, respectively, when you apply the strategy above. If the scale is balanced, the position is described by the text 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