#include <bits/stdc++.h>
using namespace std;
struct node {
  int a, b;
} x[110], y[110];
long long dist(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) + (y1 - y2);
}
int main() {
  int n, m, i, j;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> x[i].a >> x[i].b;
  }
  for (j = 1; j <= m; j++) {
    cin >> y[j].a >> y[j].b;
  }
  for (i = 1; i <= n; i++) {
    int dism = dist(x[i].a, y[1].a, x[i].b, y[1].b);
    int id = 1;
    for (int j = 2; j <= m; j++) {
      int disc = dist(x[i].a, y[j].a, x[i].b, y[j].b);
      if (disc < dism) {
        dism = disc;
        id = j;
      }
    }
    cout << id << endl;
  }
  return 0;
}
