An $n \times m$ matrix of distinct integers is given, then $Q$ queries, each a value $x$ guaranteed to be present. For each query print the position of $x$ as row col (0-based).
Input
Line 1: $n$ $m$. Next $n$ lines: the matrix. Then $Q$ and $Q$ values.
Output
Print the row col of each queried value, one per line.
Example 1
Input
3 4 10 20 30 40 50 60 70 80 90 100 110 120 3 70 10 120
Output
1 2 0 0 2 3
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.