This page is still under construction.

Parts of this page are still being built. What you see may change.

Hide those letters

Time limit1sMemory limit128 MB

Summary
The program replaces every occurrence of two given letters in both cases with underscores.
Level

Easy1 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

Mrs Jones teaches at a primary school, and she thought of a way to help her pupils learn to spell. She removes certain letters from a sentence and puts underscore characters in their place. The children then write the right letters into the blanks. To start with, Mrs Jones picks two different letters from a sentence, say a and e, and the children work out whether each underscore stands for an 'a' or an 'e'.

Input

The input holds several cases and ends with a line containing just # #. Each case begins with a line holding two lowercase letters separated by a space. The next line holds an integer 1≤n≤1001 \le n \le 100, the number of text lines in the case. Each of the following nn lines holds a line of text of up to 255 characters.

Output

For each case, first print the case number in the form Case k, where kk counts from 1 in case order. Below it print one line for every line of text in that case. The text is the same as the input, except that every occurrence of either of the two letters becomes the underscore character _. The two letters are given in lowercase, but their uppercase forms must be replaced as well. Print a blank line between cases.

Examples1

  1. Example 1

    Input
    a e
    2
    Come here Evans, said the teacher.
    I think not.
    p r
    1
    Purple reindeer rarely appear in Ruritania.
    # #
    
    Expected output
    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.