import numpy as np,sys

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

N,M = LI()

ab = np.array([LI() for _ in range(N)],dtype=int)

cd = np.array([LI() for _ in range(M)],dtype=int)

for x in ab:

    vector = np.sum(np.abs(cd-x),axis=1).tolist()

    print((vector.index(min(vector))+1))

import numpy as np,sys

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

N,M = LI()

ab = np.array([LI() for _ in range(N)])

cd = np.array([LI() for _ in range(M)])

for x in ab:

    print((np.argmin(np.sum(np.abs(cd-x),axis=1))+1))

import numpy as np, sys


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))


N, M = LI()
ab = np.array([LI() for _ in range(N)], dtype=int)
cd = np.array([LI() for _ in range(M)], dtype=int)
for x in ab:
    vector = np.sum(np.abs(cd - x), axis=1).tolist()
    print((vector.index(min(vector)) + 1))

import numpy as np, sys


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))


N, M = LI()
ab = np.array([LI() for _ in range(N)])
cd = np.array([LI() for _ in range(M)])
for x in ab:
    print((np.argmin(np.sum(np.abs(cd - x), axis=1)) + 1))

-ab = np.array([LI() for _ in range(N)], dtype=int) -cd = np.array([LI() for _ in range(M)], dtype=int) +ab = np.array([LI() for _ in range(N)]) +cd = np.array([LI() for _ in range(M)]) -    vector = np.sum(np.abs(cd - x), axis=1).tolist() -    print((vector.index(min(vector)) + 1)) +    print((np.argmin(np.sum(np.abs(cd - x), axis=1)) + 1))