Extended Locations

There are a number of locations that are part of an adventure game. At each location there is a given set of characters and a given set of items. Print the list of locations on the appropriate format.

Input

The input starts with an integer NN denoting the number of locations. The next NN lines contain the name of the locations.

The next line contains an integer MM denoting the number of characters. The next MM lines contain the description of each character on the format “<<character name>>-<<character level>> <<location name>>”.

The next line contains an integer KK denoting the number of items. The next KK lines contain the description of each character on the format “<<item name>>-<<item level>> <<location name>>”.

Output

For each location in the order they appear in the input, print the location and its associated items and characters on the format specified in the example.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T14:59:23.428Z

© Jutge.org, 2006–2026.
https://jutge.org