A search engine is designed to quickly locate words within a large text. In this task, you are required to implement a variant of a search engine that identifies the line numbers in a given text where all words from a specified set appear.
The first line of the input file contains a sequence of words. The following lines of the file contain the text. A word consists of characters from the Latin alphabet. Words are separated by characters that are not Latin alphabet letters or by line breaks.
Uppercase and lowercase Latin letters are considered equivalent. The sequence contains no more than words. Each word is at least character long and no more than characters long. The text contains no more than lines and no more than distinct words. Lines consist of characters with codes ranging from to , inclusive. The file size does not exceed MB.
In the output file, print the line numbers of the text that satisfy the task's condition, in ascending order.
Example 1