Under construction

Still being built. Things may change

Mia's Note

Interview

Time limit1sMemory limit256 MB

Summary
Given an H by N*W grid formed by smearing a length-N string, fill in each original character from any non-'?' cells and mark the rest '?'.
Level

Easy3 of 10

Topics
Implementation, String, Array, Simulation
Solved
No attempts yet

Problem

Mia is a girl who loves fruit. Her secret note is full of information she has collected about fruit.

One day, as she was walking home happy after observing a lot of fruit as usual, a friend jumped on her from behind and accidentally dropped her secret note into water.

Fortunately she was able to fish the note out, but the information written in it had smeared and been erased, so some of it was no longer legible.

The way the string written in the note smeared followed a fixed pattern. For example, when the characters "abc" smeared into 3 characters vertically and 2 characters horizontally, the result was as follows.

aabbcc
aabbcc
aabbcc

It seemed that the string could be fully restored using this pattern, but unfortunately part of the smeared string had been erased. If too much has been erased to infer the character at a position, the string may not be fully restorable.

Mia is very upset that her cherished note fell into water. Let us restore the string as completely as possible and cheer Mia up!

Input

The first line gives the length of the original string N, the number of characters it smeared vertically H, and the number of characters it smeared horizontally W. (1 ≤ N ≤ 100, 1 ≤ H ≤ 10, 1 ≤ W ≤ 10)

From the second line, H lines each give a string of length N × W. Each string consists only of lowercase English letters or '?'. A '?' means the character at that position has been erased.

The input never contains a contradiction, such as two or more different characters at a position where a character smeared.

Output

Print the original string before it was damaged. Print '?' for each character that cannot be restored.

Examples2

  1. Example 1

    Input
    3 2 2
    a?????
    ???bcc
    
    Expected output
    abc
    
  2. Example 2

    Input
    6 2 3
    ???rrruuu???ttt???
    f?f?rruuu?????t???
    
    Expected output
    fru?t?