#include <bits/stdc++.h>
using namespace std;
void Lancer() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool isPrime(long long n) {
  if (n == 2 || n == 3 || n == 5)
    return true;
  else if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n == 1)
    return false;
  else {
    for (int i = 5; i <= sqrt(n); i += 2) {
      if (n % i == 0) return false;
    }
    return true;
  }
}
int frq[57];
int main() {
  Lancer();
  long long n, m, res, dis, indx = 0;
  cin >> n >> m;
  vector<pair<int, int> > stud(n + 2), pnt(n + 2);
  for (int i = 0; i < n; i++) cin >> stud[i].first >> stud[i].second;
  for (int i = 0; i < m; i++) cin >> pnt[i].first >> pnt[i].second;
  for (int i = 0; i < n; i++) {
    res = 1000000000000000000;
    for (int j = 0; j < m; j++) {
      if (!frq[j]) {
        dis = abs(stud[i].first - pnt[j].first) +
              abs(stud[i].second - pnt[j].second);
        if (dis <= res) {
          indx = j + 1;
          res = dis;
        }
      }
    }
    frq[indx - 1] = 1;
    cout << indx << "\n";
  }
  return 0;
}
