시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB | 302 | 160 | 128 | 53.333% |
Two players F
(irst) and S
(econd) play a game with three jars each containing $a$, $b$ and $c$ pebbles. The game is played according to the following rules:
F
starts first, then S
next. These turns alternate till the game ends.F
at the first turn is $1$. So in the next turn, S
takes $2$ pebbles, then at the third turn, F
takes $3$ pebbles, and so on.F
and S
do their best to win.Given the number of pebbles in three jars, write a program to find who is the winner or if the draw is possible.
Your program is to read from standard input. The input starts with a line containing three integers, $a$, $b$ and $c$ ($1 ≤ a, b, c ≤ 100$) denoting the number of pebbles in three jars at the beginning.
Your program is to write to standard output. Print exactly one line. The line should contain a capital letter among {F
, S
, D
}. {F
, S
} means the winner among two players and D
denotes a draw when the game ends.
2 5 3
F
4 1 5
D
5 3 5
S