Under construction

Still being built. Things may change

Padaeng Studies Hard as a Middle Schooler

Time limit1sMemory limit1024 MB

Summary
Given a paper of 3x8 cells, each holding an addition equation a+b=c, mark the margin of correct equations with stars and wrong ones with slashes.
Level

Easy3 of 10

Topics
Implementation, String
Solved
No attempts yet

Problem

Padaeng, a middle school student, has too much to do and finds her studies hard, so her mind is always scattered. Today her teacher gave her the dreadful assignment of solving addition problems.

Padaeng finished the assignment somehow, but grading it is a huge chore. So she wants to write a program that reads her assignment and grades it automatically. Help Padaeng!

The paragraphs below describe the requirements in detail. For an intuitive explanation, see the sample input and sample output.

Padaeng's assignment paper is a matrix of size 3N×8M3N \times 8M. Problems are written on the paper, and each problem takes up 3 rows and 8 columns. The problems are arranged in NN rows and MM columns, forming a sheet of N×MN \times M problems in total. Each 3×83 \times 8 area consists of a body and margin. The body is a string of length 5 or 6 written horizontally. It always starts at row 2, column 2 of the given 3×83 \times 8 matrix. The body is always an equation of the form a+b=ca + b = c. aa and bb are single-digit numbers, and cc is a one-digit or two-digit number. Any of aa, bb, or cc may be 0. However, if cc has two digits, its tens digit is not 0. The margin is always given as the character . .

Padaeng's assignment is graded as follows. For each problem, the following procedure is carried out. If the equation in the body is correct, fill every element of the margin that is adjacent to the body, up, down, left, or right, with the character *. If the equation is wrong, fill the elements at row 3, column 2, row 2, column 3, and row 1, column 4 of the matrix containing the problem with the characters / .

Input

The first line contains two integers NN and MM, separated by a space, which give the size of the paper. (1≤N,M≤70)(1 \leq N, M \leq 70)

From the second line onward, 3N3N lines give the matrix that represents Padaeng's sheet, as strings. Each line has length 8M8M.

Output

Print 3N3N strings of length 8M8M that show the result of grading Padaeng's test sheet.

Examples1

  1. Example 1

    Input
    2 2
    ................
    .2+3=5...3+4=6..
    ................
    ................
    .1+4=7...8+8=16.
    ................
    
    Expected output
    .*****...../....
    *2+3=5*..3/4=6..
    .*****.../......
    .../.....******.
    .1/4=7..*8+8=16*
    ./.......******.