#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a(n);
vector<int> b(n);
vector<int> c(m);
vector<int> d(m);
int func(int id) {
  int best = 1e9;
  int ans = -1;
  for (int i = 0; i < m; i++) {
    int dist = abs(a[id] - c[i]) + abs(b[id] - d[i]);
    if (dist < best) {
      best = dist;
      ans = i;
    }
  }
  return ans + 1;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < (n); ++i) cin >> a[i] >> b[i];
  for (int i = 0; i < (n); ++i) cin >> c[i] >> d[i];
  for (int i = 0; i < (n); ++i) cout << func(i) << endl;
  return 0;
}
