Problem 1B
Word Construction

Description

A word (doublet) is written on two cards, for example :

A new word is formed by joining a substring from the first card to the second, e.g. :

Here the word "PUTTER" is formed.

You will be given one doublet, followed by a list of words, and you must print all words from the list that can be formed in the above way as a pair of substrings.

For this problem, valid substrings must have at least two letters.

Input

The input is the doublet, followed by N, (1 <= N <= 10) the number of words in the list, followed by the N words, one per line. All words (including the doublet) will be in uppercase letters, and will have between 2 and 32 letters.

Output

The output will be any words that can be formed by taking two substrings from the doublet. Each word should appear on a line on its own.

Example 1

Input

COMPUTER
3
ONION
CUTE
PUTTER

Output

PUTTER

Example 2

Input

PAW
3
APAW
PAPA
WAP

Output

PAPA