Fred got a simple task, he just has to build a $$$w\times h$$$ wall. To make this even easier, he was provided with enough $$$2\times1$$$ bricks and also a few $$$1\times1$$$ bricks to complete the wall. Knowing that this task should not be too hard, Fred went to work and started building the wall without thinking too much about the design. Only when he ran out of $$$1\times1$$$ bricks, Fred noticed that this might have been a bad idea...
Visualization of Sample Input $$$2$$$. The red bricks have already been placed by Fred. The blue bricks still need to be placed to complete the wall (the only possible design in this case). The input consists of:
Output "possible" if Fred can complete his wall and "impossible" otherwise.
3 3 0 0 1
possible
6 3 1 0 1 1 0 1
possible
6 2 1 0 1 1 0 1
impossible
5 2 1 2 3 2 2
impossible