Emit Magic

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. Your task is to simulate several actions in the adventure game.

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 type>>-<<character name>>-<<character level>> <<location name>>”. Valid character types are “Cure”, “Damage” and “Character”.

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 type>>-<<item name>>-<<item level>> <<location name>>”. Valid item types are “Bomb”, “Potion”, “Trap” and “Item”.

The next line contains an integer AA denoting the number of actions. The next AA lines contains the description of each action, which can be either “Use” or “Distribute”. The format for each type of action is
“Use-<<character name>>-<<item name>>-<<location name>>” “Distribute-<<location name>>-<<magic amount>>

Output

For each location in the order they appear in the input, print the result of applying each action in the adventure game, on the format specified in the example.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T22:52:56.108Z

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