#include <bits/stdc++.h>
using namespace std;
int a[55], b[55], c[55], d[55], tc[55];
int main() {
  int n, m, f = 0;
  pair<int, int> min;
  min.first = 10 ^ 8;
  min.second = 1;
  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++) {
    min.first = 10000000000;
    min.second = 1;
    for (int j = 0; j < m; j++) {
      for (int k = 0; k < f; k++) {
        if (j == tc[k]) {
          j++;
          k = 0;
        }
      }
      if (j == m) break;
      int y = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (y < min.first) {
        min.second = j + 1;
        min.first = y;
      }
    }
    cout << min.second << endl;
    tc[f] = min.second - 1;
    f++;
  }
  return 0;
}
