a,b = map(int, input().split())
x = []
z = []
m =19999999999999
s  = 1
for i in range(a):
    ta , tb = map(int, input().split()) 
    x.append([ta,tb])
for i in range(a):
    ta , tb = map(int, input().split())
    z.append([ta,tb])
for ta , tb in x:
    s = 0
    m =19999999999999
    for n,(s,y) in enumerate(z):
        print(n,s,y)
        # print(m , abs(s-ta)+abs(y-tb))
        if m >= abs(s-ta)+abs(y-tb):
            m = abs(s-ta)+abs(y-tb)
            s = n
    print(s+1)