Under construction

Still being built. Things may change

Reveals

Time limit1sMemory limit512 MB

Summary
Given the people in a house and the names seen outside, find the culprit by applying seven priority rules in order.
Level

Easy2 of 10

Topics
Implementation, Hash map, Sorting
Solved
No attempts yet

Problem

Hweeh...

Someone took advantage of the darkness and ate Swi's enormous cake!

Swi loves cake. As usual, Swi set a huge cake bought from a nearby shop on the table and was admiring it. But the room was so warm that Swi fell asleep, and when Swi woke up, the cake was gone!

When the incident happened, there were Swi and NN other people in the house. The culprit is one of the people in the house at that time.

Swi asked around and collected the names of MM people who were seen somewhere other than the house at the time of the incident.

This case follows the principles of detective fiction, so the culprit can be deduced by the following rules.

  1. The rules below are applied in priority order. If two or more rules identify a culprit at the same time, the rule with the smaller number takes precedence.
  2. Dongho is a villain. If dongho was in the house at the time of the incident, dongho is the culprit regardless of the sightings.
  3. If exactly one person in the house has no sighting, that person is the culprit by elimination.
  4. If a person named bumin with no sighting was in the house, that person is the culprit.
  5. If a person named cake with no sighting was in the house, that person is the culprit, since the cake is a lie (The cake is a lie).
  6. If a person named lawyer with no sighting was in the house, that person is the culprit, since lawyers are always the culprit.
  7. People whose names come first alphabetically find it easier to sneak cake. Among the NN people in the house other than Swi, the one with no sighting and the alphabetically smallest name is the culprit.

Swi fell asleep in the room with the cake, so Swi was not seen anywhere else.

Each name is unique, and no two people share a name.

A person may have been seen several times, and a person who was seen may have been outside the house at the time of the incident.

Find the culprit who ate Swi's cake.

Input

The first line contains the message that Swi's cake is missing. (swi's cake is missing!)

The second line contains the number of people NN in the house, not counting Swi.

The next NN lines each contain the name of one of those NN people, one name per line.

The next line contains the number of sightings MM.

The next MM lines each contain the name of a person seen outside the house at the time of the incident.

Output

Print the name of the culprit who ate Swi's cake, according to the rules.

Constraints

  • Every name is a string of 1 to 8 lowercase English letters.
  • The culprit can be uniquely identified using the rules in the problem.
  • 0≤N≤10000 \le N \le 1000
  • 0≤M≤100000 \le M \le 10000

Examples1

  1. Example 1

    Input
    swi's cake is missing!
    5
    dongho
    potato
    cake
    bumin
    dhyang
    5
    dongho
    dongho
    dongho
    dongho
    dongho
    
    Expected output
    dongho