#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a(n), b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i].first >> b[i].second;
  }
  for (int i = 0; i < n; i++) {
    int idx = 1;
    int mn = 1e9;
    for (int j = 0; j < n; j++) {
      int dis = abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
      if (dis < mn) {
        mn = dis;
        idx = j + 1;
      }
    }
    cout << idx << '\n';
  }
  return 0;
}
