try: input=raw_input
except: pass

import sys
from functools import cmp_to_key

def byTP(u,v):
  (x,y,z) = u
  (X,Y,Z) = v
  return x - X if not (x == X) else Y - y

def byAngle(u,v):
  (x,y,z) = u
  (X,Y,Z) = v
  return x * Y - X * y

def abscissa(list, u):
  (x,y,z) = u
  if (list == []):
    return False
  (X,Y,Z) = list[-1]
  if (Y < y):
    list.pop()
    return True
  return False

def convex(list, c):
  (cx,cy,cz) = c
  if (len(list) < 2):
    return False
  (ax,ay,az) = list[-2]
  (bx,by,bz) = list[-1]
  d = (cx-bx) * (by-ay) - (cy-by) * (bx-ax)
  if (d < 0 or (d == 0 and (bz > az or bz > cz))):
    list.pop()
    return True
  return False

def convexHull(dish):
  list = []
  for p in dish:
    while(abscissa(list, p) or convex(list, p)):
      {}
    list.append(p)
  return list

def favourite(M, targets, people):
  tab = [0] * M
  i = 0
  s = len(targets)
  for p in people:
    b = True
    (u,v,w) = p
    while (b and s > i+1):
      (x,y,z) = targets[i]
      (X,Y,Z) = targets[i+1]
      d = u * (x - X) + v * (y - Y)
      if (d < 0 or (d == 0 and z > Z)):
        i = i+1
      else:
        b = False
    (x,y,z) = targets[i]
    tab[w] = z+1
  return tab

N,M = map(int,input().split())
dish = []
people = []
for i in range(N):
  t,p = map(int,input().split())
  dish.append((t,p,i))
for j in range(M):
  t,p = map(int,input().split())
  people.append((t,p,j))
dish = sorted(dish, key=cmp_to_key(byTP))
targets = convexHull(dish)
people = sorted(people, key=cmp_to_key(byAngle))
tab = favourite(M, targets, people)
for d in tab:
  print(d)
