Prettify Text Blocks
You are given a rectangular text block, consisting of periods "." and asterisks "*". Two horizontally or vertically adjacent asterisks are connected. You task is to convert each asterisk to a different character, depending on how it connects to other asterisks. An asterisk is converted to:
"o" (the lower case letter o) if it is not connected,
"-" if it is only connected horizontally (left/right/left and right),
"|" if it is only connected vertically (up/down/up and down),
"+" otherwise.
Input
The first input line contains the number of test cases N, 1 ≤ N ≤ 50.
Each test case begins with a line containing integers h and w, separated by space. h lines follow. Each line i, 1 ≤ i ≤ h, consists of a string s. The input text block is represented by vertically stacking s_1, s_2, ..., s_h.
h is the height of the text block, and satisfies 1 ≤ h ≤ 50.
w is the width of the text block, and satisfies 1 ≤ w ≤ 50.
For each i, 1 ≤ i ≤ h, s_i is a length-w string of periods "." or asterisks "*".
Output
For each test case, print h lines of length-w strings, represents the converted text block. Print a blank line between test cases, but not after the last test case.