Letter Cookies#1194

Letter Cookies

1 second
64 megabytes
Very easy

Letter cookies are on sale again! Your little sister is trying to make words from the letters in the box. Your task is to determine whether she can form specific words using these letters.

After making each word, she returns all the letters to the box, so each word is formed independently and any letter may be reused for each word.

Input

The first line contains the number of test cases — the number of cookie boxes your sister has.

Each test case starts with a line containing all the letters in the box, in arbitrary order. The next line contains , the number of words your sister wants to form, followed by lines, each containing a word.

  • 0 < T \leq 100

  • 0 < W \leq 100

  • All letters are uppercase English letters (–).

  • Each box contains no more than letters.

  • Each word contains no more than letters (the word does not have to be an English dictionary word).

Output

For each word, output on a separate line YES if the word can be formed with the cookie letters, or NO otherwise.

Examples

Example 1

Loading
Loading