~/algor $ cat problems/tosh-qaychi-kaltakesak
Rock, scissors, lizard
Medium
1000 ms
64 MB
47%
The game has five moves: t — rock, q — scissors, g — paper, k — lizard, s — Spock. Rules: rock beats scissors and lizard; scissors beat paper and lizard; paper beats rock and Spock; lizard beats Spock and paper; Spock beats scissors and rock. The moves of two players are given. Print $1$ if the first player wins, $2$ if the second player wins, and $0$ if the moves are the same.
Input
One line with two characters: the first and the second player's moves.
Output
One integer: $1$, $2$ or $0$.
Note
Each character is t, q, g, k or s.
Examples
Input #1
k s
Output #1
1
Input #2
t g
Output #2
2