A matrix of dimension (M,N) has M*N elements in the format of M rows(橫列) and N columns(直行), and thus each element has a pair of index (i, j), where i is less than M, j is less than N, and both are greater or equal to 0. For example, a matrix A of dimension (2, 3) may look like this:
[ 1 3 5 ]
[ 2 4 6 ]
where the element A(0,1) is 3 and A(1, 0) is 2.
In this problem, a matrix and a few indexes is given. What you have to do is to find out the corresponding elements from the matrix according to the given indexes.
The input consists of four parts.
The output be P lines, where P is the given number in the third part of the input. Each line should be exactly one integer that is the corresponding element in the given matrix.