Finding a Word in a Text

Time Limit: 1 Second    Memory Limit: 32768 KB

Find out whether a given text file contains a given word W.

If the word W exists in the file, place in the output file the line number and the position in the line number of the last entry of the word. Otherwise place two numbers: 0 0. During text analysis do not take into consideration word carry-over, that is, the sought for word may begin on one line and end on another. The text may as well contain empty lines, which are also numbered, but must not be taken into account in searching for the word W.

Length (L) of the word W complies with the condition: 0 < L <= 255.

Length (S) of the lines of the input file complies with the condition: 0 <= S <= 255.

The number of lines in the input file does not exceed 100000.

The input text may contain any symbols in the range of 32..255. The input text does NOT contain any other symbols.

Input

The first line of the input file contains the word W. A word here is understood as a non-empty sequence of symbols. The second line contains the number of lines to follow. Beginning with the third(!) line the text, consisting of one or more lines (maybe empty), goes.

Process to the end of file.

Output

The output numbers must be separated by one space.

Sample Input

Word
5
Word

www W

orddd

Sample Output

3 5
Submit