Roshambo — this simple game is known all around the world. In German, it is called “Schnick, Schnack, Schnuck”, in Japanese “Janken”, in Spanish “Cachip′un”, in Polish “Papier, kamie′n, no˙zyce”. The Czechs call it “K′amen, n?uˇzky, pap′?r”.
Whatever is the name of the game, its principles remain the same. Two players simultaneously form their hand into one of three possible shapes (symbols): Rock (closed fist), Paper (open hand), or Scissors (two fingers extended). If both of them show the same symbol, it is a tie and no points are given. Otherwise, one of the symbols wins: Rock blunts Scissors, Scissors cut Paper, and Paper covers Rock.
Czech Technical University students also know the game very well and use it to resolve small disputes. Imagine, for example, two students living together in one room. Yesterday evening, there was a small celebration, and in the morning, no one wants to go to the lectures. They agreed that one person would be enough to take notices for both, but who will be the poor one? Roshambo is a very effective way to decide.
Did you know there are even the World Series of Roshambo? Our organizing team would like to host the World Championships in 2009. Your task is to help us in developing a Roshambo scoring system and write a program that evaluates one game between two players.
Since the participants will come from di?erent countries, the system must accept input in various languages. The following table shows names of three Roshambo symbols. Note that in some languages, there may be two different words for the same symbol.