#P7550. [COCI 2020/2021 #6] Bold

[COCI 2020/2021 #6] Bold

Description

Paula wrote a letter to Daniel, and she needs to make the text bold so that Daniel, whose eyesight is getting worse, can read it.

The letter can be represented as a matrix consisting of . and #. For every # originally in the letter, Paula needs to expand it to the lower-right into a 2×22 \times 2 block of #.

Input Format

The first line contains two integers n,mn, m, representing the size of the letter.

The next nn lines each contain mm characters, representing the content of the letter.

It is guaranteed that there is no # in the last row and the last column.

Output Format

Output nn lines, each containing mm characters, representing the letter after being made bold.

4 4
....
.#..
....
....
....
.##.
.##.
....
7 7
.......
.####..
.#...#.
.#...#.
.#...#.
.####..
.......
.......
.#####.
.######
.##..##
.##..##
.######
.#####.
9 7
.......
.####..
.#...#.
.#...#.
.####..
.#.....
.#.....
.#.....
.......
.......
.#####.
.######
.##..##
.######
.#####.
.##....
.##....
.##....

Hint

Constraints

For 100%100\% of the testdata, 2n,m1032 \le n, m \le 10^3. It is guaranteed that the letter contains only . and #.


Notes

The score of this problem follows the original COCI settings, with a full score of 5050.

Translated from COCI2020-2021 CONTEST #6 T1 Bold.

Translated by ChatGPT 5