CSES - Aalto Competitive Programming 2024 - wk10 - Mon - Modern art
  • 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 AA and the perimeter of the figure is PP.

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 ss and tt there is a path from ss to tt where each step goes up, down, left or right and all the pixels are black along the way.

The surface area AA of the figure is the number of black pixels. The perimeter PP is the number of horizontal or vertical edges between black and white pixels.

Input

A single line contains two integers AA and PP.

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 xx pixels wide and yy pixels high, you will need to output yy rows, each with xx characters, and each character is either 0 (representing a white pixel) or 1 (representing a black pixel).

Constraints

  • 1A10001 \leq A \leq 1000
  • 4P4×A4 \leq P \leq 4 \times A

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