#C12040. Find Book Positions

    ID: 41424 Type: Default 1000ms 256MiB

Find Book Positions

Find Book Positions

You are given a list of book titles and a list of query strings. For each query, determine the 1-indexed position of the book in the list if it exists. The search is case-sensitive, meaning that the title must match exactly. If the book is not found, output "Not found" for that query.

In mathematical terms, if we denote the array of book titles as \(B = [b_1, b_2, \dots, b_n]\) and the array of queries as \(Q = [q_1, q_2, \dots, q_m]\), then for each query \(q_j\), output the index \(i\) (where \(1 \leq i \leq n\)) such that \(b_i = q_j\), or output "Not found" if no such \(i\) exists.

inputFormat

The input is read from stdin and is formatted as follows:

  1. An integer \(n\) representing the number of book titles.
  2. \(n\) lines follow, each containing a book title.
  3. An integer \(q\) representing the number of queries.
  4. \(q\) lines follow, each containing a query string.

outputFormat

For each of the \(q\) queries, output the corresponding 1-indexed position of the book if found, otherwise output Not found. Each answer should be printed on a new line to stdout.

## sample
5
The Great Gatsby
1984
To Kill a Mockingbird
The Catcher in the Rye
Pride and Prejudice
3
1984
To Kill a Mockingbird
Pride and Prejudice
2

3 5

</p>