E. Grid Sums
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

While bored in class, your friend doodled an $$$N \times N$$$ grid of binary digits 0 and 1. She then computed the sum of each row and column.

You wonder: knowing these row and column sums, can you construct a grid of binary digits whose rows and columns have those sums? (There might not be a unique answer, so your grid doesn't have to exactly match your friend's original grid.)

Input

The first line of input contains a single integer $$$N$$$ $$$(1 \leq N \leq 8)$$$, the size of the grid you need to construct.

The second line contains $$$N$$$ space-separated integers $$$c_i$$$ $$$(0 \leq c_i \leq N)$$$, the sums of the columns of the grid, in order from left to right.

The last line contains $$$N$$$ space-separated integers $$$r_i$$$ $$$(0 \leq r_i \leq N$$$), the sums of the rows of the grid, in order from top to bottom.

It is guaranteed that the $$$r_i$$$ and $$$c_i$$$ were computed from an $$$N\times N$$$ grid of binary digits.

Output

Print $$$N$$$ lines of exactly $$$N$$$ 0 or 1 characters each: a grid whose row and column sums match the sums in the input. If there are multiple possible such grids, you may print any one of them.

Examples
Input
4
1 0 1 0
0 1 1 0
Output
0000
0010
1000
0000
Input
1
0
0
Output
0
Input
8
5 3 3 4 3 3 2 3
4 4 1 3 6 2 4 2
Output
00001111
00001111
00000001
10110000
11111100
10010000
11110000
11000000