#include <bits/stdc++.h>
using namespace std;
const int kMaxN = 50;
const int kMaxD = 200000000;
struct Point {
  int x, y;
};
int main() {
  int n, m;
  Point a[kMaxN], b[kMaxN];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i].x >> a[i].y;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i].x >> b[i].y;
  }
  for (int i = 0; i < n; i++) {
    int min = kMaxD;
    int ans = 0;
    for (int j = 0; j < m; j++) {
      int d = abs(a[i].x - b[j].x) + abs(a[i].y - b[j].y);
      if (min > d) {
        min = d;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
