Given an $N \times M$ chessboard, initially, all positions on the board are empty.
Not a Little Blue Fish wants to perform several operations. Each operation is as follows:
- Choose an empty cell $(i, j)$.
- Let $x$ be the smallest positive integer that has not yet appeared in the row or column containing $(i, j)$.
- Fill the cell $(i, j)$ with the number $x$.
Not a Little Blue Fish wants you to perform a sequence of operations such that the number $X$ is filled into a cell for the first time at the very last operation. Additionally, Not a Little Blue Fish requires the total number of operations $Q$ to be exactly within the range $[L, R]$. You are asked to construct a possible sequence of operations or report that no such solution exists.
Input
The input consists of a single line containing five integers $N, M, X, L, R$.
Output
If no such solution exists, output a single integer -1.
Otherwise, output the first line containing an integer $Q$ ($L \le Q \le R$), representing the number of operations.
The next $Q$ lines each contain two integers $(i, j)$, describing each operation in order.
Examples
Input 1
7 10 7 10 100
Output 1
43
1 1
2 2
3 3
4 4
5 5
6 6
7 7
1 2
2 3
3 4
4 5
5 6
6 7
7 1
1 3
2 4
3 5
4 6
5 7
6 1
7 2
1 4
2 5
3 6
4 7
5 1
6 2
7 3
1 5
2 6
3 7
4 1
5 2
6 3
7 4
1 6
2 7
3 1
4 2
5 3
6 4
7 5
1 7
Subtasks
For all data, $1 \leq N, M \leq 500$, $1 \leq L \leq R \leq 10^9$, $1 \leq X \leq 10^9$.
Subtask 1 (6 points)
$N \leq 20$
$M \leq 20$
Subtask 2 (6 points)
$N \leq 2$
Subtask 3 (14 points)
$N \leq 5$
Subtask 4 (5 points)
$L = 1, R = 10^9$
Subtask 5 (23 points)
$L = 1$
Subtask 6 (25 points)
$N \neq M$
Subtask 7 (21 points)
No additional constraints.