import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Vincent {
	private record Point(long x, long y, int z) {
	}

	private static boolean abscissa(Point[] dish, List<Point> list, Point p) {
		int s = list.size();
		if (s >= 1) {
			if (list.get(s - 1).y() <= p.y()) {
				list.remove(s - 1);
				return true;
			}
		}
		return false;
	}

	private static boolean convex(Point[] dish, List<Point> list, Point c) {
		int s = list.size();
		if (s >= 2) {
			Point a = list.get(s - 2);
			Point b = list.get(s - 1);
			long bcx = c.x() - b.x();
			long bcy = b.y() - c.y();
			long abx = b.x() - a.x();
			long aby = a.y() - b.y();
			if (bcx * aby > bcy * abx) {
				list.remove(s - 1);
				return true;
			} else if (bcx * aby == bcy * abx && (b.z() > a.z() || b.z() > c.z())) {
				list.remove(s - 1);
				return true;
			}
		}
		return false;
	}

	private static int byXY(Point a, Point b) {
		return a.x() > b.x() ? 1 : a.x() < b.x() ? -1 : a.y() < b.y() ? 1 : a.y() > b.y() ? -1 : 0;
	}

	private static int byAngle(Point a, Point b) {
		long ax = a.x();
		long ay = a.y();
		long bx = b.x();
		long by = b.y();
		long d = bx * ay - ax * by;
		return d < 0 ? 1 : d > 0 ? -1 : 0;
	}

	private static List<Point> convexHull(Point[] dish) {
		List<Point> list = new ArrayList<>();
		for (Point p : dish) {
			while (abscissa(dish, list, p) || convex(dish, list, p)) {
			}
			list.add(p);
		}
		return list;
	}

	private static long like(Point p, Point d) {
		long px = p.x();
		long py = p.y();
		long dx = d.x();
		long dy = d.y();
		return px * dx + py * dy;
	}

	private static int[] favourite(int M, List<Point> targets, Point[] people) {
		int[] tab = new int[M];
		int i = 0;
		int s = targets.size();
		for (Point p : people) {
			boolean b = true;
			while (b && i + 1 < s) {
				long l1 = like(p, targets.get(i));
				long l2 = like(p, targets.get(i + 1));
				if (l1 < l2 || (l1 == l2 && targets.get(i).z() > targets.get(i + 1).z())) {
					i++;
				} else {
					b = false;
				}
			}
			tab[p.z()] = targets.get(i).z() + 1;
		}
		return tab;
	}

	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] line = br.readLine().split(" ");
		int N = Integer.parseInt(line[0]);
		int M = Integer.parseInt(line[1]);
		Point[] dish = new Point[N];
		Point[] people = new Point[M];
		for (int i = 0; i < N; i++) {
			line = br.readLine().split(" ");
			int t = Integer.parseInt(line[0]);
			int p = Integer.parseInt(line[1]);
			dish[i] = new Point(t, p, i);
		}
		for (int j = 0; j < M; j++) {
			line = br.readLine().split(" ");
			int t = Integer.parseInt(line[0]);
			int p = Integer.parseInt(line[1]);
			people[j] = new Point(t, p, j);
		}
		br.close();
		Arrays.sort(dish, Vincent::byXY);
		Arrays.sort(people, Vincent::byAngle);
		List<Point> targets = convexHull(dish);
		int[] fav = favourite(M, targets, people);
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		for (int i = 0; i < M; i++) {
			bw.write(fav[i] + "\n");
		}
		bw.close();
	}

	public static void main(String[] args) throws IOException {
		read();
	}
}

