"""

https://abc057.contest.atcoder.jp/tasks/abc057_b

"""

[n,m]=[int(i) for i in input().split()]

ab=[]

cd=[]

k=[]

box=[]

l=0

for i in range(n):

    ab.append([int(j) for j in input().split()])

for i in range(m):

    cd.append([int(j) for j in input().split()])



for i in range(n):

    for j in range(m):

        k.append(abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1]))

    #kには全てのjについてのマンハッタン距離が入る

    box.append(k)

    k=[]





for i in range(n):

    for j in box[i]:

        if j == min(box[i]):

            l=l+1

            print(l)

            break

        l=l+1

    l=0



[n,m] = [int(i) for i in input().split()]

ls_st = []

ls_ch = []

for j in range(n):

    ls_st.append([int(i) for i in input().split()])

for j in range(m):

    ls_ch.append([int(i) for i in input().split()])

ans = []

for i in range(n):

    dist = 10**20;

    place = -1

    for j in range(m):

        if dist > (abs(ls_st[i][0] - ls_ch[j][0])+abs(ls_st[i][1] - ls_ch[j][1])):

            dist = (abs(ls_st[i][0] - ls_ch[j][0])+abs(ls_st[i][1] - ls_ch[j][1]))

            place = j+1

    ans.append(place)

for i in range(n):

    print((ans[i]))

"""
https://abc057.contest.atcoder.jp/tasks/abc057_b
"""
[n, m] = [int(i) for i in input().split()]
ab = []
cd = []
k = []
box = []
l = 0
for i in range(n):
    ab.append([int(j) for j in input().split()])
for i in range(m):
    cd.append([int(j) for j in input().split()])
for i in range(n):
    for j in range(m):
        k.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]))
    # kには全てのjについてのマンハッタン距離が入る
    box.append(k)
    k = []
for i in range(n):
    for j in box[i]:
        if j == min(box[i]):
            l = l + 1
            print(l)
            break
        l = l + 1
    l = 0

[n, m] = [int(i) for i in input().split()]
ls_st = []
ls_ch = []
for j in range(n):
    ls_st.append([int(i) for i in input().split()])
for j in range(m):
    ls_ch.append([int(i) for i in input().split()])
ans = []
for i in range(n):
    dist = 10**20
    place = -1
    for j in range(m):
        if dist > (abs(ls_st[i][0] - ls_ch[j][0]) + abs(ls_st[i][1] - ls_ch[j][1])):
            dist = abs(ls_st[i][0] - ls_ch[j][0]) + abs(ls_st[i][1] - ls_ch[j][1])
            place = j + 1
    ans.append(place)
for i in range(n):
    print((ans[i]))

-""" -https://abc057.contest.atcoder.jp/tasks/abc057_b -""" -ab = [] -cd = [] -k = [] -box = [] -l = 0 +ls_st = [] +ls_ch = [] +for j in range(n): +    ls_st.append([int(i) for i in input().split()]) +for j in range(m): +    ls_ch.append([int(i) for i in input().split()]) +ans = [] -    ab.append([int(j) for j in input().split()]) -for i in range(m): -    cd.append([int(j) for j in input().split()]) +    dist = 10**20 +    place = -1 +    for j in range(m): +        if dist > (abs(ls_st[i][0] - ls_ch[j][0]) + abs(ls_st[i][1] - ls_ch[j][1])): +            dist = abs(ls_st[i][0] - ls_ch[j][0]) + abs(ls_st[i][1] - ls_ch[j][1]) +            place = j + 1 +    ans.append(place) -    for j in range(m): -        k.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])) -    # kには全てのjについてのマンハッタン距離が入る -    box.append(k) -    k = [] -for i in range(n): -    for j in box[i]: -        if j == min(box[i]): -            l = l + 1 -            print(l) -            break -        l = l + 1 -    l = 0 +    print((ans[i]))