Magic Spell Dictionary

Source: Internet
Author: User

"Title description"

It is said that the wizarding world has 100000 different enchantments and gives you a spell dictionary. When you hear a curse, your program must say the function of the spell, and your program will find the appropriate enchantments for you when you need a feature but don't know what to use. If the spell you want is not in the dictionary, output "what?".

"Input description"

First, the dictionary contains no more than 100,000 different spell entries, each of which is: [enchantment] corresponding function.

where enchantments and corresponding functions are strings that do not exceed 20 and 80 in length, the string guarantees that the characters "[" and "]" are not included, and that there is only one space between the "]" and the subsequent strings. The last line of the dictionary ends with "@[email protected", which does not belong to the dictionary entry.

The line after the dictionary contains a positive integer n (n <= 1000) followed by n test cases. Each test case takes on one line, or "[enchantments]", or "corresponding function".

"Output description"

The output of each test case is one line, the output enchantment corresponds to the function, or the function corresponding to the enchantments. If the enchantment is not in the dictionary, output "what?".

"Sample Input"

[Expelliarmus] the disarming charm[Rictusempra] send a jet of silver light to hit the enemy[Tarantallegra] control the movement of one ' s legs[Serpensortia] Shoot a snake out of the end of one ' s wand[Lumos] Light The Wand[obliviate] the memory charm[Expecto patronum] Send a Patronus to the Dementors[Accio] the summoning charm@[email protected]4[Lumos]The summoning Charm[Arha]Take me to the Sky"Sample Output"

Light the Wand

Accio

What?

What?

Magic Spell Dictionary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.