Sam the monkey has recently been playing a grid game in his AAC retirement home. Keenan the monkey came to visit him, and Sam showed him his game.
Sam's game is played on a grid with
Sam has been having trouble getting the number
Keenan is actually unsure that this is possible, or how to do it, so please help him out.
Constraints
Subtask 1 [20%]
Subtask 2 [30%]
Subtask 3 [50%]
No additional constraints.
Input Specification
The first and only line of input will contain five space-separated integers,
Output Specification
If it is impossible to produce
Otherwise, output an integer
If you output an invalid cell, repeat a cell, produce WA
.
Note: Any valid output will be accepted.
Sample Input
4 4 4 1 16
Sample Output
6
1 1
2 1
3 1
1 2
1 3
1 4
Explanation
The moves produce, in order, the values
Comments