Code Theft

No attempts yetTime limit1sMemory limit128 MB

Problem

Every time new source code is pushed to the company repository, you want a monitoring system that automatically checks whether that code was copied verbatim from open source published on the internet.

The system compares the entire newly submitted source against every known open source file, one by one. For each open source file, it finds the length of the longest run of consecutive lines that overlaps with the submitted source.

The comparison is done line by line, under the following rules.

  • Blank lines and lines that consist only of whitespace are not compared and are not counted. (Such lines are treated as if they were absent, so the meaningful lines before and after them are considered adjacent.)
  • Leading and trailing whitespace on each line is ignored.
  • Any run of consecutive whitespace inside a line is treated as a single space.
  • All comparisons are case-insensitive.

After both sources are normalized by these rules, the overlap with a file is the length of the longest block of lines that appears consecutively in both.

Input

The first line contains the number of known open source files $N$. ($0 \le N \le 100$)

Then the information of the $N$ open source files follows in order. Each open source begins with a line containing its file name, followed by the lines of its source code. The end of the source code is marked by a single line ***END***, which is not part of the source code. A file name contains no whitespace, is unique, and is at most 254 characters long.

After all open sources are given, the source code to be compared is given. Its end is also marked by a single line ***END***.

Every line is at most 254 characters long, and a single source code has at most 10000 lines. Source code and file names contain only ASCII characters 32 through 126, and the whole input is at most $10^6$ characters long.

Output

On the first line, print the number of lines in the longest run that consecutively overlaps with the submitted source. (Blank lines are not counted.)

Then print a single space followed by the name of the open source file that achieves this maximum length. If several files achieve it, print all of them, separated by spaces, in the order they were given in the input.

If there is no overlapping line at all (the maximum length is $0$), print only $0$.