Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans) 

Fixed submission:
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    B.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

C=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans) 

Fixed submission:
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    B.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

C=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
    if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans) 

Fixed submission:
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    B.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

C=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
    if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
        else:
            continue
    print(ans) 

Fixed submission:
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    B.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])
print(A)
for i in range(M):
    c, d = map(int, input().split())
    saitei = float("inf")
    for j in range(N):
        if abs(A[j][0]-c) + abs(A[j][1]-d) < saitei:
            saitei = abs(A[i][0]-c) + abs(A[i][1]-d)
            ans = j+1   
        else:
            continue
    print(ans) 

Fixed submission:
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    B.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)