two friends, Anna and Maria, decided to combine their culinary recipes. Each of them has its own dictionary, where the key is the name of the dish, and the value is the list of ingredients. Your task is to help them create one common culinary book, uniting their dictionaries. If both books have a recipe with the same name, it is necessary to combine the lists of ingredients so that the general book has a complete list of all the necessary ingredients for this dish (without repetitions).
Input format
First, the number & nbsp; n & nbsp;-the number of recipes in Anna's culinary book. Then they are introduced & nbsp; n & nbsp; lines, each line contains the name of the recipe (line) and through the gap of the ingredient list (a line separated by commas). Next, the number & nbsp; m & nbsp;- the number of recipes in the culinary book of Maria. Then, & nbsp; m lines in a similar format: the name of the recipe (line) and through the gap of the ingredient list (string separated by commas)
Output format
The United Culinary Book is displayed in the format (string) and through the gap of the ingredient list (string separated by commas). Recipes should be sorted in alphabetical order by name
Example
Input
2
Pies apple apples, flour, sugar
Vegetable cucumbers, tomatoes, onions
1
Pie apple cinnamon, flour
Output
Pies cinnamon flour sugar apple apples
salad onion vegetable cucumbers tomatoes
Hint
There will be no clue here, decide for yourself!