Spring 2005: Arriving at USC

No attempts yetTime limit1sMemory limit256 MB

Problem

The first contest, held in the spring of 2005, took its material from around the USC campus, and its name was simply "The USC Contest". One piece of that material was building name abbreviations such as SAL, PHE, OHE, or SSL. The students back then were asked to write a program that returns every candidate building name an abbreviation could refer to, and now you are asked the same thing.

You are given a list of building names and one building abbreviation, such as SAL or LOL. The abbreviation matches a building name when all of its letters appear in that name in this order. No letter of the name can be matched twice. For example, SAL matches "SALvatori", "Student Aerospace Laboratory", and "univerSity of southern cALifornia". It does not match "angeles", because the letters come in the wrong order. The comparison ignores case, so 'S' and 's' are the same letter. The capital letters above are only a marker showing which letters were matched.

Input

The first line contains the number K of data sets. K data sets follow, each in this form.

The first line of a data set contains the number n of buildings (1n1001 \le n \le 100). The next n lines each contain the name of a building, made of uppercase letters, lowercase letters, and spaces. The building abbreviation then follows on a line by itself and is made of letters only. Each string is at most 100,000 characters long.

Output

For each data set, print "Data Set x:" on a line by itself, where x is the number of the data set.

Then print every building name that matches the abbreviation, one per line, in the order in which the names appeared in the list.

Print one blank line after each data set.