Padaeng Studies Hard as a Middle Schooler
Time limit1sMemory limit1024 MB
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 . Problems are written on the paper, and each problem takes up 3 rows and 8 columns. The problems are arranged in rows and columns, forming a sheet of problems in total. Each 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 matrix. The body is always an equation of the form . and are single-digit numbers, and is a one-digit or two-digit number. Any of , , or may be 0. However, if 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 and , separated by a space, which give the size of the paper.
From the second line onward, lines give the matrix that represents Padaeng's sheet, as strings. Each line has length .
Output
Print strings of length that show the result of grading Padaeng's test sheet.