#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int mod = 1000000007;
const int inf = 0x3f3f3f3f;
const int maxn = 2000100;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int a = n, b = m;
  vector<int> x1(n), y1(n);
  vector<int> x2(n), y2(n);
  for (int i = 0; i < n; i++) {
    cin >> x1[i] >> y1[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> x2[i] >> y2[i];
  }
  for (int i = 0; i < n; i++) {
    long long mn = 1000000000000;
    int pos;
    for (int j = 0; j < m; j++) {
      long long ans = abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]);
      if (ans < mn) {
        mn = ans;
        pos = j + 1;
      }
    }
    cout << pos << "\n";
  }
  return 0;
}
