Give you an algorithm set and an article, please answer whether algorithms in the given set appears in the article.

Submit: 703 Solved: 288

[Submit][Status][Web Board]

Give you an algorithm set and an article, please answer whether algorithms in the given set appears in the article.

The first line of input is the number of test cases T (1 <= T <= 100)

For each test case, the first line will be an integer n (1 <= n <= 10). The next n lines describe the given algorithm set. Each line will contain a string.

Then there will be an integer m (1 <= m <= 1000). Then there will be m words (strings) describe the article. These strings are separated by space.

We guarantee the given string only contains lowercase and uppercase English letters. And the length of each string is less than 100.

For each article, if one of the given algorithms appears in the article, print “Appeared” (without quotes). Otherwise print “Not appeared” (without quotes).

```
2
3
DynamicProgramming
SweepLine
dijkstra
8
We can solve this problem by sweepline algorithm
3
DynamicProgramming
SweepLine
dijkstra
9
Dijkstra algorithm can be used to solve SSSP problem
```

```
Appeared
Appeared
```