#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int INF = 0x3f3f3f3f;
int p1() {
  int a, b;
  cin >> a >> b;
  return (a + b + 24) % 24;
}
void p2() {
  int m, n;
  cin >> m >> n;
  vector<int> study;
  while (m) {
    int a1, b1;
    cin >> a1 >> b1;
    study.push_back(a1);
    study.push_back(b1);
    m--;
  }
  vector<int> point;
  while (n) {
    int c1, d1;
    cin >> c1 >> d1;
    point.push_back(c1);
    point.push_back(d1);
    n--;
  }
  int dist2 = 0;
  int ma = INT_MAX;
  int x, y;
  for (int i = 0; i < study.size(); i = i + 2) {
    for (int j = 0, index = 0; j < point.size(); j = j + 2, ++index) {
      dist2 = abs(study[i] - point[j]) + abs(study[i + 1] - point[j + 1]);
      if (dist2 < ma) {
        ma = dist2;
        x = i + 1, y = index + 1;
      }
    }
    cout << y << endl;
    dist2 = 0;
    ma = INT_MAX;
  }
}
int main() {
  p2();
  return 0;
}
