#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> c(n);
  vector<long long> d(n);
  for (int i = 0; i < (n); i++) cin >> a.at(i) >> b.at(i);
  for (int i = 0; i < (m); i++) cin >> c.at(i) >> d.at(i);
  map<int, long long> mp;
  for (int i = 0; i < (n); i++) {
    long long dis = 1e9;
    for (int j = 0; j < (m); j++) {
      long long temp = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      dis = min(dis, temp);
    }
    mp[i] = dis;
  }
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (m); j++) {
      if (abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j)) == mp[i]) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}
