시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB31018416761.397%

문제

Mrs Jones, a primary school teacher, has thought of a way to help her young pupils to learn to spell. She is removing certain letters from sentences and replacing them with underscore characters. The children have to write the appropriate letters in the spaces. As a starting point, Mrs Jones takes 2 different letters from a sentence (such as a and e), and the children have to work out whether each underscore represents an 'a' or an 'e', for example.

입력

Input to this problem will consist of a number of cases, terminated by a line containing just # #. Each case will begin with two lower case letters on a single line, separated by a space, followed by a line containing a single integer n (1 ≤ n ≤ 100) which gives the number of lines of text making up the case. The following n lines each contain a line of text of up to 255 characters.

출력

Output for each case will be the case number, followed by 1 line for each line of text presented in the input. The text will be as input but with every occurrence of either of the two letters replaced by an underscore character (_). Although the letters provided are in lowercase, uppercase versions of the same letter must also be replaced. Leave a blank line between cases.

예제 입력 1

a e
2
Come here Evans, said the teacher.
I think not.
p r
1
Purple reindeer rarely appear in Ruritania.
# #

예제 출력 1

Case 1
Com_ h_r_ _v_ns, s_id th_ t__ch_r.
I think not.

Case 2
_u__le _eindee_ _a_ely a__ea_ in _u_itania.