#include <bits/stdc++.h>
using namespace std;
struct student {
  int x;
  int y;
} ans[55], res[55];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> ans[i].x >> ans[i].y;
  }
  for (int i = 1; i <= m; i++) {
    cin >> res[i].x >> res[i].y;
  }
  for (int i = 0; i < n; i++) {
    int b = 1;
    int x = ans[i].x;
    int y = ans[i].y;
    int mi = 100000001;
    for (int j = 1; j <= m; j++) {
      int k = abs(x - res[j].x) + abs(y - res[j].y);
      if (k < mi) {
        mi = k;
        b = j;
      }
    }
    cout << b << endl;
  }
}
