#include <bits/stdc++.h>
using namespace std;
int dist(int y1, int x1, int y2, int x2) { return abs(x1 - x2) + abs(y1 - y2); }
int main() {
  int n, m;
  cin >> n >> m;
  pair<int, int> a[n + m];
  for (int i = 0; i < n + m; i++) {
    int t1, t2;
    cin >> t1 >> t2;
    a[i].first = t1;
    a[i].second = t2;
  }
  for (int i = 0; i < n; i++) {
    int min = 100000000;
    int d;
    int mp;
    for (int j = 0; j < m; j++) {
      d = dist(a[i].first, a[i].second, a[n + j].first, a[n + j].second);
      if (min > d) {
        min = d;
        mp = j + 1;
      }
    }
    cout << mp << endl;
  }
}
