A terrible word search: find the word DREAM in this grid.

### Input

The first line contains a word $$w$$ that only consists of letters.

The second line contains a number $$n \in \mathbb{N}_0$$. This is followed by another $$n$$ lines, each containing a fixed number of letters (at least as much as there are letters in the word $$w$$). These $$n$$ lines make up the grid of a word search in which the word $$w$$ can be read just once from left to right or from right to left. When reading the word, no distinction is made between uppercase and lowercase letters.

### Output

The lines that make up the grid of the word search, where only the letters that spell the word are in uppercase and all other letters in lowercase.

### Example

Input:

Dream
4
AEaArAeAae
mmDddaarra
mmaeMAerDR
RraMeEmMEA

Output:

aeaaraeaae
mmdddaarra
mmaeMAERDr
rrameemmea

### Example

Input:

DREAM
30
MMDARDEEEDEEAMEDDAAREAEAMDRAAAEDAMER
RDEMMDRMRARMRDREMEEAARMRAARAERRDMDED
RDMEMMDRREAAAMRREDEEMMMEMRDARDDDDEDD
DEDMEDRAEMDRRDERMMMEMARAAAMRRDDRAMAA
EAAMEARDEMEEMEDAREMRRRDEEEEAARAEEEDM
ADAMDAMADMMRREDAMRDDAAADMEEAAEAAAERM

Output:

eaeededemdreaerrmerrredmeamamadraarr
mmdardeeedeeameddaareaeamdraaaedamer
rdemmdrmrarmrdremeeaarmraaraerrdmded
rdmemmdrreaaamrredeemmmemrdarddddedd
dedmedraemdrrdermmmemaraaamrrddramaa
adamdamadmmrredamrddaaadmeeaaeaaaerm