#include <bits/stdc++.h>
const int N = 0;
using namespace std;
long long int solve(long long int w, long long int a, long long int b) {
  int res;
  int c = min(a, b);
  int d = max(a, b);
  c += w;
  res = d - c < 0 ? 0 : d - c;
  return res;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> students;
  vector<pair<int, int>> checkPoints;
  for (int i = 0, almo5t = n; i < almo5t; ++i) {
    int val1, val2;
    cin >> val1 >> val2;
    students.push_back(make_pair(val1, val2));
  }
  for (int i = 0, almo5t = m; i < almo5t; ++i) {
    int x, y;
    cin >> x >> y;
    checkPoints.push_back(make_pair(x, y));
  }
  for (int i = 0, almo5t = n; i < almo5t; ++i) {
    long long int min = 300000000;
    int idx = -1;
    for (int j = 0, almo5t = m; j < almo5t; ++j) {
      long long int temp = abs(students[i].first - checkPoints[j].first) +
                           abs(students[i].second - checkPoints[j].second);
      if (temp < min) {
        min = temp;
        idx = j + 1;
      }
    }
    cout << idx << "\n";
  }
  return 0;
}
