Find a set of patterns 1#2171

Find a set of patterns 1

1 second
64 megabytes
Easy

For each string from the given set S, check whether it contains at least one string from the set T as a substring.

Input

The first line contains a natural number (n \leq 100), the number of strings in set T. Each of the next lines contains a nonempty string of no more than characters.

The remaining part of the input contains the strings from set S. Each line consists of ASCII characters with codes from to inclusive. A string may be empty; it is guaranteed that the string length does not exceed characters.

It is guaranteed that the total size of the input file does not exceed MB.

Output

Print all the strings from set S (in the same order as in the input) that contain at least one string from set T as a substring.

Examples

Example 1

Loading
Loading