# Quick and dirty translation into python of raphael_v1.cpp

def area(O, P, Q):
  return (P[0] - O[0]) * (Q[1] - O[1]) - (P[1] - O[1]) * (Q[0] - O[0])

class Dish:
    def __init__(self, a, b, i):
        self.p = [a, b]
        self.index = i

class Person:
    def __init__(self, a, b, i):
        self.p = [a, b]
        self.index = i
    def __lt__(self, other):
        return area([0, 0], other.p, self.p) < 0

def read_dishes(N):
    dishes = [Dish(0, 0, i) for i in range(N)]
    for i in range(N):
        dishes[i].p = [int(x) for x in input().split(' ')]
    return dishes
            
def read_persons(N):
    persons = [Person(0, 0, i) for i in range(N)]
    for i in range(N):
        persons[i].p = [int(x) for x in input().split(' ')]
    return persons
        
def extend_hull(new_point, hull):
    while len(hull) >= 2 and area(hull[-2].p, hull[-1].p, new_point.p) > 0:
        del hull[-1]
    hull.append(new_point)

def compute_hull(inputs):
    inputs.sort(key=lambda x: (x.p[0], -x.p[1]))
    hull = []
    for p in inputs:
        extend_hull(p, hull)
    return hull


def dot(d, p):
    return d.p[0] * p.p[0] + d.p[1] * p.p[1]


def find_lowest_index(dishes, start, person):
    cur_affinity = dot(dishes[start], person);
    dish_lowest_index = start
    lowest_index = int(1e9)
    for cur in range(start, len(dishes)):
        if dot(dishes[cur], person) != cur_affinity:
            break
        if dishes[cur].index < lowest_index:
            lowest_index = dishes[cur].index
            dish_lowest_index = cur
    return dish_lowest_index


def solve(dishes, persons):
    hull = compute_hull(dishes)
    hull.reverse()
    persons.sort()
    preferred = [-1] * len(persons)
    dish = 0
    got_lowest_index = False
    for person in persons:
        while dish + 1 < len(hull):
            cur_affinity = dot(hull[dish], person)
            next_affinity = dot(hull[dish + 1], person)
            if cur_affinity > next_affinity:
                got_lowest_index = False
                break
            if cur_affinity < next_affinity:
                got_lowest_index = False
                dish += 1
                continue
            if cur_affinity == next_affinity:
                if got_lowest_index:
                    break
                dish = find_lowest_index(hull, dish, person)
                got_lowest_index = True
                break
        preferred[person.index] = hull[dish].index

    return preferred


if __name__ == '__main__':
    N, M = [int(x) for x in input().strip().split(' ')]
    dishes = read_dishes(N)
    persons = read_persons(M)
    for x in solve(dishes, persons):
        print(x + 1)
