#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;
template <typename T>
void printA(vector<T> &printArray, char between = ' ') {
  int paSize = printArray.size();
  for (int i = 0; i < paSize; i++) {
    cerr << printArray[i] << between;
  }
  if (between != '\n') {
    cerr << endl;
  }
}
using pii = pair<int, int>;
int N, M;
int a[55], b[55], c[55], d[55];
int main() {
  cin >> N >> M;
  for (int(i) = (0); (i) < (N); ++(i)) {
    cin >> a[i] >> b[i];
  }
  for (int(i) = (0); (i) < (M); ++(i)) {
    cin >> c[i] >> d[i];
  }
  for (int(i) = (0); (i) < (N); ++(i)) {
    int dist = 1e8, p = 0;
    for (int(j) = (0); (j) < (M); ++(j)) {
      int t = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (t < dist) {
        dist = t, p = j + 1;
      }
    }
    cout << p << endl;
  }
  return 0;
}
