#include <bits/stdc++.h>
using namespace std;
int inf = 1e9;
int main() {
  int n, m;
  vector<int> a(n), b(n), c(m), d(m), ans(n);
  for (int i = 0; i < n; i++) {
    int dst = inf, ans = -1;
    for (int j = 0; j < m; j++) {
      if (dst > abs(a[i] - c[j]) + abs(b[i] - d[j])) ans = j + 1;
    }
  }
  for (auto&& u : ans) cout << u << endl;
}
