Interesting Game
Limits: 2 sec., 256 MiB
Little Imp and Dragon like to spend their spare time together. Today they are playing an interesting game.
The game is played on N by M board. Initially all board cells are white. The players alternate turns and Little Imp starts the game. While making a turn a player selects a white board cell and paints it black. A player who can not make a valid move (because all the board is black) looses the game and his opponent is considered to be a winner.
Your task is to determine the game winner.
Input
Two integers N and M separated by a space.
Output
Print "Imp" (quotes for clarity) if Little Imp wins the game otherwise print "Dragon".
Constraints
\(1 \le \mathbf{N}, \mathbf{M} \le 100\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 7 4 | Dragon |
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
Interesting Game - Editorial
On every move exactly one white cell is painted black. So the total number of moves equals the number of white cells on the board. There are \(n \cdot m\) white cells on the board. If this number is even, the Dragon makes the last move and wins. Otherwise the Imp wins.
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|