|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초||128 MB||126||3||1||1.562%|
There is a chessboard of the size M×N. K fairy chess pieces called (p, q)-leapers (p < q) are placed in some squares on this board. Leaper’s move is similar to a regular chess knight’s move, with some constraints though. When (p, q)-leaper moves, it can move p squares horizontally and qsquares vertically (only upward), or q squares horizontally (only leftward) and p squares vertically. In other words, the move to q squares must be in a direction where corresponding coordinate decreases. Moving outside of the board is prohibited. However several leapers are allowed to occupy the same square.
Two players are playing the game, alternating moves. In his turn a player chooses some leaper and moves it according to the rules. The player who is not able to move any leaper loses the game. Givena board configuration determine the winner, assuming both players play optimally.
The first line of input contains 5 integers: M, N, K, p, q (1 ≤ M, N ≤ 109, 1 ≤ K ≤ 105, 1 ≤ p < q ≤ 20). Each of following K lines contains coordinates riand ciof corresponding leaper (1 ≤ ri≤ M, 1 ≤ ci≤ N).
The single line of output should contain stringFirst, if the first player wins the game under optimal strategy, andSecondotherwise.
10 10 2 1 2 3 7 7 3
7 5 3 1 3 2 3 1 5 4 3