void main() {
    int[] tmp = readln.split.to!(int[]);
    int n = tmp[0], m = tmp[1];
    int[] a = new int[n], b = new int[n];
    foreach (i; 0 .. n) {
        tmp = readln.split.to!(int[]);
        a[i] = tmp[0], b[i] = tmp[1];
    }
    int[] c = new int[m], d = new int[m];
    foreach (i; 0 .. m) {
        tmp = readln.split.to!(int[]);
        c[i] = tmp[0], d[i] = tmp[1];
    }
    foreach (i; 0 .. n) {
        int point;
        int distance = int.max;
        foreach (j; 0 .. m) {
            int len = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if (len < distance) {
                point = j + 1;
                distance = len;
            }
        }
        point.writeln;
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;