#t143. 画布裁剪
画布裁剪
Canvas Cropping
Problem Description
Little A drew a picture on a rectangular canvas of height and width . Because there is too much blank margin around the picture, Little A wants to crop the canvas and keep only the main part of the picture. Specifically, the canvas can be viewed as a character matrix of rows and columns, where every character has an ASCII code between and (visible characters). Little A keeps only the submatrix formed by rows to and columns to .
Little A hands the canvas to you. Can you help him crop it?
Input Format
The first line contains two positive integers and , the number of rows and columns of the canvas. The second line contains four positive integers , the kept row and column boundaries. The following lines each contain a string of length , the content of the canvas.
Output Format
Output lines, each a string of length : the cropped canvas.
Sample Input
Sample Input 1
3 5
2 2 2 4
.....
.>_<.
.....
Sample Input 2
5 5
1 2 3 4
AbCdE
fGhIk
LmNoP
qRsTu
VwXyZ
Sample Output
Sample Output 1
>_<
Sample Output 2
Cd
hI
Sample Explanation
For sample 1, the canvas is rows and columns; the crop region is rows to and columns to . This region contains only row , which is the string .>_<.; taking its columns to gives the substring >_<. So the program outputs >_<.
Constraints
For all test points, , , .