#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  vector<vector<int> > a(N, vector<int>(2)), c(M, vector<int>(2));
  for (int i = 0; i < (N); i++) {
    for (int j = 0; j < (2); j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < (M); i++) {
    for (int j = 0; j < (2); j++) {
      cin >> c[i][j];
    }
  }
  int counter = 100000000;
  int ans;
  for (int i = 0; i < (N); i++) {
    int distance;
    for (int j = 0; j < (M); j++) {
      distance = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]);
      if (distance < counter) {
        ans = j + 1;
        counter = distance;
      }
    }
    cout << ans << endl;
    counter = 100000000;
  }
}
