eolymp
bolt
Try our new interface for solving problems
Problems

Game on Chessboard

Game on Chessboard

There is a chessboard of the size \textbf{M}×\textbf{N}. \textbf{K} fairy chess pieces called (\textbf{p}, \textbf{q})-leapers (\textbf{p} < \textbf{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 (\textbf{p}, \textbf{q})-leaper moves, it can move \textbf{p} squares horizontally and \textbf{q} squares vertically (only upward), or \textbf{q} squares horizontally (only leftward) and \textbf{p} squares vertically. In other words, the move to \textbf{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. \InputFile The first line of input contains \textbf{5} integers: \textbf{M}, \textbf{N}, \textbf{K}, \textbf{p}, \textbf{q} (\textbf{1} ≤ \textbf{M}, \textbf{N} ≤ \textbf{10^9}^\{ \}, \textbf{1} ≤ \textbf{K} ≤ \textbf{10^5}^\{ \}, \textbf{1} ≤ \textbf{p} < \textbf{q} ≤ \textbf{20}). Each of following \textbf{K} lines contains coordinates \textbf{r_i} and \textbf{c_i} of corresponding leaper (\textbf{1} ≤ \textbf{r_i} ≤ \textbf{M}, \textbf{1} ≤ \textbf{c_i} ≤ \textbf{N}). \OutputFile The single line of output should contain string \textbf{First}, if the first player wins the game under optimal strategy, and \textbf{Second} otherwise.
Time limit 1 second
Memory limit 64 MiB
Input example #1
10 10 2 1 2
3 7
7 3
Output example #1
Second