#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int i, j, n, m, min, num;
  cin >> n >> m;
  int dis, a[n], b[n], c[m], d[m];
  for (i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (i = 0; i < m; i++) cin >> c[i] >> d[i];
  for (i = 0; i < n; i++) {
    min = 1000000;
    for (j = 0; j < m; j++) {
      dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > dis) {
        min = dis;
        num = j;
      }
    }
    cout << num + 1 << endl;
  }
  return 0;
}
