Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/case-kozirli-karta

Trump card

Easy 1000 ms 64 MB 26%
Share

A card is given by its value $N$ and suit $M$. Values: $6$ — olti (six), $7$ — yetti (seven), $8$ — sakkiz (eight), $9$ — to'qqiz (nine), $10$ — o'n (ten), $11$ — valet (jack), $12$ — dama (queen), $13$ — qirol (king), $14$ — tuz (ace). Suits: $1$ — g'isht (diamonds), $2$ — olma (hearts), $3$ — chillak (clubs), $4$ — qarg'a (spades). The first player has played the card $(N_{1}; M_{1})$, the second wants to beat it with the card $(N_{2}; M_{2})$; $K$ is the trump suit. The second card beats the first if both cards are of the same suit and $N_{2} > N_{1}$, or if the second card is a trump and the first is not. Otherwise the first card wins. Print the name of the winning card: the value first, then the suit.

Two playing cards compared with the trump suit

Input

One line with five integers: $N_{1}$, $M_{1}$, $N_{2}$, $M_{2}$ and $K$.

Output

One line with the name of the winning card: the value word and the suit word separated by one space (for example, dama olma).

Note

$6 \le N_{1}, N_{2} \le 14$
$1 \le M_{1}, M_{2}, K \le 4$
The two cards are different.

Examples

Input #1
10 2 12 2 1
Output #1
dama olma
Input #2
14 3 6 1 1
Output #2
olti g'isht

Sign in to submit a solution

Signing up is free and takes a minute.