- Time limit: 1.00 s
- Memory limit: 512 MB
There is an grid, and your task is to choose from each row and column some number of squares. How can you do that?
Input
The first input line has an integer : the size of the grid. The rows and columns are numbered .
The next line has integers : You must choose exactly squares from the th row.
The las line has integers : You must choose exactly squares from the th column.
Output
Print lines describing which squares you choose (X
means that you choose a square, .
means that you don't choose it). You can print any valid solution.
If it is not possible to satisfy the conditions print only .
Constraints
Example
Input:
5 0 1 3 2 0 1 2 2 0 1
Output:
..... ..X.. .XX.X XX... .....