Program for Psychological Research of Programmers#5408

Program for Psychological Research of Programmers

2 seconds
256 megabytes
Easy

The company "Macrohard" has hired a renowned psychologist to conduct an extensive psychological study of all its employees. This psychologist, famous for his innovative approach, can develop a complete psychological profile of an employee by analyzing the most frequently used identifier in their programs. Unfortunately, the program used for this analysis was unexpectedly corrupted by a virus, necessitating the urgent creation of a new one. Your task is to assist the psychologist by writing a program that identifies the most frequently used identifier in a given program.

Input

The first line contains the number — the number of keywords in the language (0 \leq n \leq 50), followed by two words and , each of which is either "yes" or "no". The word is "yes" if the language is case-sensitive for identifiers and keywords, and "no" otherwise. The word is "yes" if identifiers in the language can start with a digit, and "no" otherwise.

The next lines contain one word each, consisting of Latin letters and underscores — these are the keywords. All keywords are non-empty and distinct (if the language is not case-sensitive, the keywords are distinct regardless of case). The length of each keyword does not exceed characters.

The remainder of the file contains the text of the program. It includes only characters with ASCII codes from to and line breaks. The input file size does not exceed kilobytes, and the program has at least one identifier.

Output

Output the identifier that appears most frequently in the program. If there are several such identifiers, output the one that appears first. If the language specified in the input file is not case-sensitive, the identifier can be output in any case.

Examples

Example 1

Loading
Loading