#include <bits/stdc++.h>
void init(int n);
int find(int n);
void unite(int x, int y);
bool same(int x, int y);
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, 1, -1, 0};
using namespace std;
int main() {
  long long int ind, N, M, a[101], b[101], c[101], d[101], m;
  cin >> N >> M;
  for (int i = 0; i < (int)(N); i++) cin >> a[i] >> b[i];
  for (int i = 0; i < (int)(M); i++) cin >> c[i] >> d[i];
  for (int i = 0; i < (int)(N); i++) {
    m = 1.0E8 + 1;
    ind = -1;
    for (int j = 0; j < (int)(M); j++) {
      if (m > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        m = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ind = j + 1;
      }
    }
    cout << ind << endl;
  }
  return 0;
}
int par[100001];
int ranks[100001];
void init(int n) {
  for (int i = 0; i < (int)(n); i++) {
    par[i] = i;
    ranks[i] = 0;
  }
}
int find(int x) {
  if (par[x] == x) {
    return x;
  } else {
    return par[x] = find(par[x]);
  }
}
void unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;
  if (ranks[x] < ranks[y]) {
    par[x] = y;
  } else {
    par[y] = x;
    if (ranks[x] == ranks[y]) ranks[x]++;
  }
}
bool same(int x, int y) { return find(x) == find(y); }
