// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
    
    int n,m;
    
    int x,y,z;
    
    int q = 1000000000;
    
    cin >> n >> m;
    
    int a[n],b[n],c[m],d[m];
    
    int result[n];
        
    for(int i = 0; i<n; i++){
        cin >> a[i] >> b[i];
    }
    
    for(int i = 0; i<m; i++){
        cin >> c[i] >> d[i];
    }
    
    for(int i = 0; i<n; i++){
        for(int j = 0; j<m; j++){
            x = a[i] - c[j];
            y = b[i] - d[j];
            
            if(x < 0){
                x = -x;
            }
            
            if(y < 0){
                y = -y;
            }
            
            z = x + y;
            
            if(z < q){
                q = z;
            }
        }
        
        result[i] = j + 1;
    }
    
    for(int i = 0; i<n; i++){
        cout << result[i] << endl;
    }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://msdn.microsoft.com/library/3bstk3k5.aspx
//   http://www.cplusplus.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   http://www.boost.org/doc/
