Fractal Cake

No attempts yetTime limit1sMemory limit128 MB

Problem

Fyodor celebrates his birthday today. Before the guests arrive he decorates a cake with chocolate cream in a special way.

At the start the cake is a square split into 4 equal white square cells — a 2×22 \times 2 grid.

Fyodor calls the following sequence of steps a fractalization:

  1. Group all current cells into non-overlapping 2×22 \times 2 groups, so that no cell is left ungrouped.
  2. Split every cell into 4 equal cells, so each 2×22 \times 2 group becomes a 4×44 \times 4 group. Every new cell keeps the color of the cell it was split from.
  3. Fill the 4 central cells (the middle 2×22 \times 2) of each 4×44 \times 4 group with chocolate.

Fyodor does not stop after one fractalization: he repeats it N times, even when he needs a microscope. The picture below shows the initial cake, the result after the first fractalization, and the cake after the fifth fractalization:

After N fractalizations the cake is a 2N+1×2N+12^{N+1} \times 2^{N+1} grid of cells. Fyodor wants a program that quickly shows the pattern of a chosen rectangular part of the cake.

Input

A single line contains five non-negative integers N, R1, R2, C1, C2:

  • N — the number of fractalization iterations (N<20N < 20).
  • R1, R2 — the first and last row of the part.
  • C1, C2 — the first and last column of the part.

Rows and columns are numbered from 0. The following restrictions hold: R1R2R1 \le R2, C1C2C1 \le C2; 0R2R1<1000 \le R2 - R1 < 100 and 0C2C1<1000 \le C2 - C1 < 100; 0R1,R2,C1,C2<2N+10 \le R1, R2, C1, C2 < 2^{N+1}.

Output

Print R2R1+1R2 - R1 + 1 lines, each containing C2C1+1C2 - C1 + 1 characters. Each character corresponds to one cell: it is 1 if the cell is filled with chocolate and 0 otherwise.