AT_abc464_b [ABC464B] Crop
Description
There is a black-and-white image of height $ H $ pixels and width $ W $ pixels. The color of the pixel at the $ i $ -th row from the top and $ j $ -th column from the left is given as a character $ C_{i,j} $ , where `.` represents white and `#` represents black.
From the top, bottom, left, and right edges of this image, remove rows and columns where all pixels are white. Specifically, perform the following operations in order:
1. While the topmost row of the image is entirely white, repeat removing the topmost row.
2. While the bottommost row of the image is entirely white, repeat removing the bottommost row.
3. While the leftmost column of the image is entirely white, repeat removing the leftmost column.
4. While the rightmost column of the image is entirely white, repeat removing the rightmost column.
Output the image after processing.
The given image contains at least one black pixel.
Input Format
The input is given from Standard Input in the following format:
> $ H $ $ W $ $ C_{1,1}C_{1,2}\ldots C_{1,W} $ $ C_{2,1}C_{2,2}\ldots C_{2,W} $ $ \vdots $ $ C_{H,1}C_{H,2}\ldots C_{H,W} $
Output Format
Output the image after processing in the following format.
Here, $ h $ and $ w $ are the height and width of the image after processing, in pixels, respectively.
$ c_{i,j} $ is the character representing the color of the pixel at the $ i $ -th row from the top and $ j $ -th column from the left; $ c_{i,j} $ must be `.` if the pixel is white and `#` if it is black.
> $ c_{1,1}c_{1,2}\ldots c_{1,w} $ $ c_{2,1}c_{2,2}\ldots c_{2,w} $ $ \vdots $ $ c_{h,1}c_{h,2}\ldots c_{h,w} $
Explanation/Hint
### Sample Explanation 1
You should remove one row from the top edge, one row from the bottom edge, one column from the left edge, and one column from the right edge.
### Sample Explanation 2
In this image, all of the topmost row, bottommost row, leftmost column, and rightmost column contain black pixels.
Therefore, without removing any rows or columns, you should output the original image as is.
### Constraints
- $ 1 \le H, W \le 50 $
- $ C_{i,j} $ is `.` or `#`.
- At least one black pixel exists.