Extended Locations X29835


Statement
 

pdf   zip

html

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 N denoting the number of locations. The next N lines contain the name of the locations.

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

The next line contains an integer K denoting the number of items. The next K 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.

Public test cases
  • Input

    5
    Creepy Cave
    Forbidden Forest
    Spooky Swamp
    Misty Mountain
    Rushing River
    2
    Wild Warrior-0 Creepy Cave
    Daring Demon-2 Forbidden Forest
    4
    Appetizing Apple-0 Creepy Cave
    Tricky Trap-2 Forbidden Forest
    Potent Potion-1 Spooky Swamp
    Bedazzling Bomb-3 Misty Mountain
    

    Output

    Location: Creepy Cave
    	Item: Appetizing Apple [0]
    - Wild Warrior is here.
    Location: Forbidden Forest
    	Item: Tricky Trap [2]
    - Daring Demon is here.
    Location: Spooky Swamp
    	Item: Potent Potion [1]
    Location: Misty Mountain
    	Item: Bedazzling Bomb [3]
    Location: Rushing River
    
  • Information
    Author
    Anders Jonsson
    Language
    English
    Official solutions
    C++
    User solutions
    C++