Campus Buildings

No attempts yetTime limit1sMemory limit128 MB

Problem

Most campuses have many buildings with long official names, so schedules use abbreviations. Over time the abbreviations become so widely used that people barely remember the full names — like SAL, PHE, or OHE. For a newcomer this is confusing, so let’s write a small program that works out which buildings an abbreviation could refer to.

You are given a list of building names and a building abbreviation such as SAL or FRSSC. The abbreviation matches a building name if every letter of the abbreviation appears in the name, in the same order, with each matched to a distinct position (no letter of the name used twice). For example, SAL matches "SALvatori", "Student Aerospace Laboratory", and "univerSity of southern cALifornia", but it does not match "angeles" because the letters appear in the wrong order. Matching is case-insensitive, so 'S' and 's' are treated as the same letter.

Input

The first line contains an integer $K \ge 1$, the number of data sets. It is followed by $K$ data sets of the following form.

The first line of a data set contains the number of buildings $n$ ($1 \le n \le 100$). The next $n$ lines each contain one building name, made up only of uppercase and lowercase letters and spaces. The last line of the data set contains the building abbreviation on a line by itself.

Output

For each data set, first print a line "Data Set x:", where x is the data set number (starting from 1). Then print every building name that the abbreviation matches, each on its own line, in the same order in which they appeared in the input list.