#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int m, n;
  cin >> n >> m;
  int a[n], b[m];
  for (long long i = (0); i < (n); i++) {
    int x, y;
    cin >> x >> y;
    a[i] = x + y;
  }
  for (long long i = (0); i < (m); i++) {
    int x, y;
    cin >> x >> y;
    b[i] = x + y;
  }
  for (long long i = (0); i < (n); i++) {
    int mini = 1000000007, point = 0;
    for (long long j = (0); j < (m); j++) {
      if (abs(a[i] - b[j]) < mini) {
        mini = abs(a[i] - b[j]);
        point = j + 1;
      }
    }
    cout << point << endl;
  }
  return 0;
}
