#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<pair<int, int> > h;
vector<pair<int, int> > c;
long long dist[50][50];
signed main() {
  cin >> N >> M;
  for (int i = 0; i < (int)(N); i++) {
    int t;
    cin >> t;
    int tt;
    cin >> tt;
    h.push_back((make_pair((t), (tt))));
  }
  for (int i = 0; i < (int)(M); i++) {
    int t;
    cin >> t;
    int tt;
    cin >> tt;
    c.push_back((make_pair((t), (tt))));
  }
  for (int i = 0; i < (int)(N); i++) {
    for (int j = 0; j < (int)(M); j++) {
      auto ph = h[i];
      auto pc = c[j];
      dist[i][j] = abs(ph.first - pc.first) + abs(ph.second - pc.second);
    }
  }
  for (int i = 0; i < (int)(N); i++) {
    long long mi = 1e18;
    for (int j = 0; j < (int)(M); j++) {
      mi = min(mi, dist[i][j]);
    }
    for (int j = 0; j < (int)(M); j++) {
      if (mi == dist[i][j]) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}
