#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
int main() {
  int n, m, a[60], b[60], c[60], d[60];
  cin >> n >> m;
  for (int i = 0; i < (int)(n); i++) cin >> a[i] >> b[i];
  for (int i = 0; i < (int)(m); i++) cin >> c[i] >> d[i];
  for (int i = 0; i < (int)(n); i++) {
    int min = INF, ans = 1;
    for (int j = 0; j < (int)(m); j++) {
      int dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis < min) {
        ans = j + 1;
        min = dis;
      }
    }
    cout << ans << endl;
  }
}
