#include <bits/stdc++.h>
using namespace std;
void put(int x) {
  if (x < 0) {
    putchar('-');
    x *= -1;
  }
  if (x == 0) {
    putchar('0');
  }
  int num = 0;
  char c[15];
  while (x) {
    c[++num] = (x % 10) + 48;
    x /= 10;
  }
  while (num) {
    putchar(c[num--]);
  }
  putchar('\n');
}
inline void in(int &x) {
  char ch = getchar();
  int flag = 1;
  while (!(ch >= '0' && ch <= '9')) {
    if (ch == '-') flag *= -1;
    ch = getchar();
  }
  x = ch - '0';
  ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = ((x << 3) + (x << 1)) + ch - '0';
    ch = getchar();
  }
  x *= flag;
}
int n, m, x, y;
struct ac {
  int a, b, id;
} a[55];
int main() {
  in(n);
  in(m);
  for (int i = 1; i <= n; i++) {
    in(a[i].a);
    in(a[i].b);
    a[i].id = i;
  }
  for (int i = 1; i <= m; i++) {
    in(x);
    in(y);
    long long ans = 1 << 30;
    int ansi = 0;
    for (int j = 1; j <= n; j++) {
      long long now = abs(x - a[j].a) + abs(y - a[j].b);
      if (now < ans) {
        ans = now;
        ansi = j;
      }
    }
    printf("%d\n", ansi);
  }
  return 0;
}
