#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const long long LINF = 1e18 + 100;
const int MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ;
  int N, M;
  cin >> N >> M;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(M);
  vector<int> d(M);
  for (int i = 0; i < (N); i++) {
    cin >> a[i];
    cin >> b[i];
  }
  for (int i = 0; i < (M); i++) {
    cin >> c[i];
    cin >> d[i];
  }
  for (int i = 0; i < (N); i++) {
    int x = a[i];
    int y = b[i];
    int dis = INF;
    int ans = 0;
    for (int j = 0; j < (M); j++) {
      int m = c[j];
      int n = d[j];
      int _dis = abs(x - m) + abs(y - n);
      if (dis > _dis) {
        dis = _dis;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
