Czech Technical University in Prague
ACM ICPC sponsored by IBM
Central Europe Regional Contest 2007
Reaux! Sham! Beaux!
roshambo.c | roshambo.C | roshambo.java | roshambo.p
Roshambo - this simple game is known all around the world. In German, it is called "Schnick,
Schnack, Schnuck", in Japanese "Janken", in Spanish "Cachipún",
in Polish "Papier, kamień, nożyce".
The Czechs call it "Kámen, nůľky, 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.
1
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 different 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.
Language
Code
Rock
Scissors
Paper
Czech
cs
Kamen
Nuzky
Papir
English
en
Rock
Scissors
Paper
French
fr
Pierre
Ciseaux
Feuille
German
de
Stein
Schere
Papier
Hungarian
hu
Ko | Koe
Ollo | Olloo
Papir
Italian
it
Sasso | Roccia
Forbice
Carta | Rete
Japanese
jp
Guu
Choki
Paa
Polish
pl
Kamien
Nozyce
Papier
Spanish
es
Piedra
Tijera
Papel
Input Specification
The input contains several games. Each game starts with two lines describing players. Each of
these two lines contains two lowercase letters specifying the language used by the player (see the
language code in the table above), one space, and a player name. The name will consist from
at most twenty upper- or lower-case letters.
1
As you know, the Regional Contest will move to Poland for the next year and we want some other international
competition at the Czech Technical University.