- Time limit: 1.00 s
- Memory limit: 512 MB
Alice asks you to create a piece of art with very specific dimensions: you need to draw a single, connected figure so that the surface area of the figure is and the perimeter of the figure is .
More precisely, your drawing has to be a black-and-white bitmap image: a figure that consists of black pixels, on a background that consists of white pixels. You can choose the canvas size freely. All pixels at the boundary of the canvas have to be white. The figure has to be connected: between every pair of black pixels and there is a path from to where each step goes up, down, left or right and all the pixels are black along the way.
The surface area of the figure is the number of black pixels. The perimeter is the number of horizontal or vertical edges between black and white pixels.
Input
A single line contains two integers and .
Output
Output a single line with the word "IMPOSSIBLE" if there is no drawing that meets these constraints, and otherwise the word "POSSIBLE" followed by a valid drawing. If the canvas that you have chosen is pixels wide and pixels high, you will need to output rows, each with characters, and each character is either 0 (representing a white pixel) or 1 (representing a black pixel).
Constraints
Example 1
Input:
2 6
Output:
POSSIBLE 0000 0110 0000
Example 2
Input:
2 7
Output:
IMPOSSIBLE
Example 3
Input:
3 8
Output:
POSSIBLE 0000 0110 0010 0000