#include <bits/stdc++.h>
using namespace std;
int solve() {}
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> ab;
  vector<pair<long long, long long>> cd;
  for (int i = 0; i < n; ++i) {
    cin >> ab[i].first >> ab[i].second;
  }
  for (int i = 0; i < m; ++i) {
    cin >> cd[i].first >> cd[i].second;
  }
  for (int i = 0; i < n; ++i) {
    int ans = -1, dist = 1e8;
    for (int j = 0; j < m; j++) {
      if (abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second) <
          dist) {
        ans = j, dist = abs(ab[i].first - cd[j].first) +
                        abs(ab[i].second - cd[j].second);
      }
    }
    cout << ans + 1 << endl;
    if ("true" == "true") {
    }
  }
}
