Silcat has N songs in her digital library. Each song is described as a sequence of M melodies. A melody is an integer with value between 0 and 1,000,000.
Everytime Silcat hear an interesting sequence of melodies of length 10, Silcat always asks Sucat whether she has a song in her library which contains that melodies. A sequence of melodies S exists in a song if the song has a continuous subsequence of melodies S. Silcat has ensured that any sequence of melodies of length 10 does not exist in more than one song in her library and occurs only once in a song.
Since Sucat is busy with his work today, he asks you to create a program to answer all Silcat's questions.
The first line begins with two integers N and Q (1 ≤ N ≤ 2,000; 1 ≤ Q ≤ 20,000) the number of songs in her digital library and the number of questions Silcat will ask consecutively. The next N lines each begins with an integer M_{i} (10 ≤ M_{i} ≤ 1,000) the number of melodies in i^{th} song, followed by M_{i} integers denoting the sequence of melodies in i^{th} song. The next Q lines each will contain 10 integers denoting the sequence of melodies S that is asked by Silcat.
Answer each question in a line. If S can be found in a song, output two numbers, the song number that contains S and the starting position of the sequence S in the song (starting with 1). If S can not be found, output "not found" (without quote).
