#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const double PI = acos(-1.0);
struct node {
  long long x, y;
} a[N], b[N];
long long d(node c, node d) { return abs(c.x - d.x) + abs(c.y - d.y); }
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i].x >> a[i].y;
    }
    for (int i = 1; i <= m; i++) {
      cin >> b[i].x >> b[i].y;
    }
    for (int i = 1; i <= n; i++) {
      long long dis = 1e18, p = 0;
      for (int j = 1; j <= m; j++) {
        if (d(a[i], b[j]) < dis) {
          dis = d(a[i], b[j]);
          p = j;
        }
      }
      cout << p << endl;
    }
  }
  return 0;
}
