Program for Psychological Research of Programmers
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.
Since employees at the company write programs in various programming languages, your program must be adaptable to any language. Different languages have different keywords, and the list of keywords for the language being analyzed will be provided as input. Identifiers are sequences of Latin letters, digits, and underscores that are not keywords and contain at least one non-digit character. In some languages, identifiers can start with a digit, while in others they cannot. If an identifier cannot start with a digit, then any sequence starting with a digit is not considered an identifier. Additionally, it will be specified whether the language is case-sensitive regarding identifiers and keywords.
Input
The first line of the input file contains the number n - the number of keywords in the language (0 ≤ n ≤ 50), followed by two words c and d, each being either "yes" or "no". The word c is "yes" if the language is case-sensitive for identifiers and keywords, and "no" if it is not. The word d is "yes" if identifiers in the language can start with a digit, and "no" if they cannot.
The next n lines each contain one word, consisting of Latin letters and underscores - these are the keywords. All keywords are non-empty, distinct, and if the language is not case-sensitive, they are distinct regardless of case. Each keyword's length does not exceed 50 characters.
The remainder of the file contains the program text. It includes only characters with ASCII codes from 32 to 126 and line breaks. The input file size does not exceed 10 kilobytes. The program contains at least one identifier.
Output
Output the identifier that appears most frequently in the program. If there are multiple 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.