#include <bits/stdc++.h>
using namespace std;
struct student {
  int x, y;
};
struct point {
  int x, y;
};
int cal(int x1, int x2, int y1, int y2) {
  int x, y;
  if (x1 - x2 < 0) {
    x = x2 - x1;
  } else {
    x = x1 - x2;
  }
  if (y1 - y2 < 0) {
    y = y2 - y1;
  } else {
    y = y1 - y2;
  }
  return (x + y);
}
int main() {
  int n, m;
  int check;
  cin >> n >> m;
  vector<student> student(n);
  vector<point> point(m);
  for (int i = 0; i < n; i++) {
    cin >> student[i].x >> student[i].y;
  }
  for (int i = 0; i < m; i++) {
    cin >> point[i].x >> point[i].y;
  }
  for (int i = 0; i < n; i++) {
    int ans = 10000000;
    for (int j = 0; j < m; j++) {
      int tmp;
      tmp = cal(student[i].x, point[j].x, student[i].y, point[j].y);
      if (tmp < ans) {
        ans = tmp;
        check = j;
      }
    }
    cout << check + 1 << endl;
  }
  return 0;
}
