On August 15, 1977, a strong narrowband radio signal was received by Ohio State University's Big Ear1 radio telescope in the United States, then assigned to a SETI2 project. The signal came from the constellation Sagittarius and its intensity rose, lasted for the full 72-second window that Big Ear was able to observe it, and then fell as the beam swept past its position in the sky.

Astronomer Jerry R. Ehman discovered the anomaly a few days later, while reviewing the recorded data. Because the signal bore all the expected hallmarks of extraterrestrial origin, he was so impressed that he circled the reading on the computer printout and wrote the comment Wow! on its side, which is how the event has since been referred to.

Wow! signal
The original printout with Ehman's handwritten exclamation next to the Wow! signal is preserved by Ohio History Connection.

Contrary to a common misconception, the Wow! signal is not actually a message. What was received appears to be an unmodulated, continuous wave signal, with no information encoded in it. The string 6EQUJ5 is simply the representation of the expected Gaussian distribution of signal intensity versus time.

The alphanumeric sequence 6EQUJ5 circled by Ehman represents the intensity variation of the radio signal over time, measured as unitless signal-to-noise ratio and ranging from 0 to 36, with the noise averaged over the previous few minutes. Each individual character corresponds to a sample of the signal, taken every 12 seconds. A whitespace character on the printout denotes an intensity between 0 and 1. The digits 1 to 9 denote the correspondingly numbered intensities (from 1 to 9). Intensities of 10 and above are indicated by a letter: A corresponds to intensities between 10 and 11, B to 11 to 12, and so on. The value U (an intensity between 30 and 31) was the highest detected by the radio telescope. On a linear scale it was over 30 times stronger than normal deep space.

At the time of the observation, the Big Ear radio telescope was only adjustable for declination (or height above the horizon), and relied instead on the rotation of the Earth to scan the sky across. Given the speed of Earth's rotation and the width of the telescope's observation window, the Big Ear could observe any given point for just 72 seconds. A continuous extraterrestrial signal, therefore, would be expected to register for exactly 72 seconds, and the recorded intensity of such signal would show a gradual increase for the first 36 seconds — peaking at the center of the observation window — and then a gradual decrease. All these characteristics are present in the Wow! signal.

But in 30 years and more than 100 searches, no one has been able to relocate it. Various hypotheses on the source of the emission have been put forward. Although the possibility of a natural origin has not been completely discounted, to date the Wow! signal is considered the best candidate for an alien radio transmission ever received. Without a recurrence, there's no way to know what Ehman's telescope heard that night — it's just a frustrating splash in a large, silent sea.

Input

The first line of input contains a number $$n \in \mathbb{N}_0$$. This is followed by another $$n$$ lines containing random text.

Ouput

The output echoes the $$n$$ lines of input, with each character that does not belong to a Wow! signal replaced by a dot (.). In takes two steps to determine whether or not a character belongs to a Wow!-signal.

At first, for each line we determine the sequences of contiguous letters and digits, where each sequence is as long as possible. In contrast to the original signal we look for horizontal sequences, not vertical sequences.

All characters that do not belong to such a sequence (all characters that are not letters nor digits) do not belong to a Wow! signal by definition. A (longest possible) sequence of contiguous letters and digits only forms a Wow! signal if the following two conditions are satisfied:

Example

Input:

21
111  1  2 11     
    6EQUJ5 11  1 
 111 2 3111      
 61 2411  4344111
                 
211  3613  1 1 1 
        1 1      
      1      1   
     1  3        
     22    11   1
  1     1 1  1   
        1 1   1  
 1   1131 3 11   
             1   
1  332 7 1 11  1 
    111 1      1 
        1 2   2  
4 1  1 1 1  11  1
 111    1   11114
          1  1   
3 1   1 1 1      

Output:

.................
....6EQUJ5.......
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.......7.........
.................
.................
.................
.................
.................
.................

Epilogue

algorithm
Animation of an algorithm that can be used to detect Wow! signals.