#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
int manhattan_dist(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> students(n);
  vector<pair<int, int>> checkpoints(n);
  for (int i = int(0); i < int(n); i++) {
    pair<int, int> p;
    cin >> p.first >> p.second;
    students[i] = p;
  }
  for (int i = int(0); i < int(m); i++) {
    pair<int, int> p;
    cin >> p.first >> p.second;
    checkpoints[i] = p;
  }
  for (auto s : students) {
    int ans = 0;
    int dist = 1000000000;
    int idx = 1;
    for (auto c : checkpoints) {
      int m = manhattan_dist(s.first, s.second, c.first, c.second);
      if (m < dist) {
        dist = m;
        ans = idx;
      }
      idx++;
    }
    cout << ans << endl;
  }
  return 0;
}
