{"raw_statement":[{"iden":"problem statement","content":"There are $N$ students and $M$ checkpoints on the $xy$\\-plane.  \nThe coordinates of the $i$\\-th student $(1 \\leq i \\leq N)$ is $(a_i,b_i)$, and the coordinates of the checkpoint numbered $j$ $(1 \\leq j \\leq M)$ is $(c_j,d_j)$.  \nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_.  \nThe Manhattan distance between two points $(x_1,y_1)$ and $(x_2,y_2)$ is $|x_1-x_2|+|y_1-y_2|$.  \nHere, $|x|$ denotes the absolute value of $x$.  \nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.  \nWhich checkpoint will each student go to?"},{"iden":"constraints","content":"*   $1 \\leq N,M \\leq 50$\n*   $-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$a_1$ $b_1$\n$:$  \n$a_N$ $b_N$\n$c_1$ $d_1$\n$:$  \n$c_M$ $d_M$"},{"iden":"sample input 1","content":"2 2\n2 0\n0 0\n-1 0\n1 0"},{"iden":"sample output 1","content":"2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\n*   For checkpoint $1$: $|2-(-1)|+|0-0|=3$\n*   For checkpoint $2$: $|2-1|+|0-0|=1$\n\nThe nearest checkpoint is checkpoint $2$. Thus, the first line in the output should contain $2$.\nThe Manhattan distance between the second student and each checkpoint is:\n\n*   For checkpoint $1$: $|0-(-1)|+|0-0|=1$\n*   For checkpoint $2$: $|0-1|+|0-0|=1$\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain $1$."},{"iden":"sample input 2","content":"3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5"},{"iden":"sample output 2","content":"3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates."},{"iden":"sample input 3","content":"5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000"},{"iden":"sample output 3","content":"5\n4\n3\n2\n1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}