#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(m);
  vector<int> d(m);
  for(int i = 0; i < n; i++){
    cin >> a.at(i) >> b.at(i);
  }
  for(int i = 0; i < m; i++){
    cin >> c.at(i) >> d.at(i);
  }
  pair<int,int> ans;
  for(int i = 0; i < n; i++){
    ans.first = abs(a.at(i) - c.at(0)) + abs(b.at(i) - d.at(0));
    ans.second = 1;
    for(int j = 1; j < m; j++){
      if(abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j)) > ans.first){
        ans.first = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
        ans.second = j + 1;
      }
    }
    cout << ans << endl;
  }
}
