#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define N 1005
struct node
{
int num;
char c[N];
}a[30];
char z[N], x[N];
int main()
{
int tot;
scanf("%d%*c", &tot);
for(int p = 1; p <= tot; p++)
{
scanf("%s%s", z, x);
for(int i = 1; i < 30; i++)
a[i].num = 0;
int n;
scanf("%d%*c", &n);
char q, w;
while(n--)
{
scanf("%c%......
阅读全文