#include <bits/stdc++.h>
using namespace std;
const int N = 60;
int n, m;
int x1[N], y1[N], x2[N], y2[N];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x1[i] >> y1[i];
  for (int i = 0; i < m; i++) cin >> x2[i] >> y2[i];
  for (int i = 0; i < n; i++) {
    int idx;
    int mins = 1e6;
    bool flag = false;
    for (int j = 0; j < m; j++) {
      if (x1[i] == x2[j] && y1[i] == y2[j]) {
        cout << j + 1 << endl;
        flag = true;
        break;
      } else if ((abs(x1[i] - x2[j] + abs(y1[i] - y2[j]))) < mins) {
        mins = (abs(x1[i] - x2[j] + abs(y1[i] - y2[j])));
        idx = j + 1;
      }
    }
    if (!flag) cout << idx << endl;
  }
  return 0;
}
