#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <class T1, class T2>
void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
using pint = pair<long long, long long>;
using tint = tuple<long long, long long, long long>;
using vint = vector<long long>;
const long long inf = 1LL << 55;
const long long mod = 1e9 + 7;
struct FordFulkerson {
  struct edge {
    long long to, cap, rev;
    edge() {}
    edge(long long to, long long cap, long long rev)
        : to(to), cap(cap), rev(rev) {}
  };
  vector<vector<edge> > graph;
  vector<bool> used;
  FordFulkerson() {}
  FordFulkerson(long long V) : graph(V), used(V) {}
  pair<long long, long long> add_edge(long long from, long long to,
                                      long long cap) {
    graph[from].emplace_back(to, cap, graph[to].size());
    graph[to].emplace_back(from, 0, graph[from].size() - 1);
    return make_pair(graph[from].size() - 1, graph[to].size() - 1);
  }
  long long dfs(long long v, long long t, long long f) {
    if (v == t) return f;
    used[v] = true;
    for (edge& e : graph[v]) {
      if (!used[e.to] && e.cap > 0) {
        long long d = dfs(e.to, t, min({f, e.cap}));
        if (d > 0) {
          e.cap -= d;
          graph[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }
  long long max_flow(long long s, long long t, long long ff = inf) {
    if (s == t) return 0;
    long long flow = 0;
    while (ff) {
      fill(begin(used), end(used), false);
      long long f = dfs(s, t, inf);
      if (f == 0) return flow;
      flow += f;
      ff -= f;
    }
    return flow;
  }
};
long long N, K;
long long x[6000], y[6000];
long long sq(long long x) { return x * x; }
long long dist(long long i, long long j) {
  return sq(x[i] - x[j]) + sq(y[i] - y[j]);
}
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);
  cin >> N >> K;
  for (long long i = 0; i < (long long)(N); i++) cin >> x[i] >> y[i];
  long long s = N, t = s + 1, V = t + 1;
  FordFulkerson graph(V);
  vector<long long> eid(N);
  for (long long i = 0; i < (long long)(N); i++) {
    if (y[i] % 2 == 0)
      eid[i] = graph.add_edge(s, i, 1).first;
    else
      eid[i] = graph.add_edge(i, t, 1).first;
    for (long long j = (long long)(i + 1); j < (long long)(N); j++) {
      if (y[i] % 2 != y[j] % 2 && dist(i, j) < 4) {
        if (y[i] % 2 == 0)
          graph.add_edge(i, j, inf);
        else
          graph.add_edge(j, i, inf);
      }
    }
  }
  long long mx_st = N - graph.max_flow(s, t);
  if (mx_st < K) {
    cout << -1 << endl;
    return 0;
  }
  vector<long long> ans;
  for (long long i = 0; i < (long long)(N); i++) {
    if (ans.size() == K) break;
    auto& e = y[i] % 2 ? graph.graph[i][eid[i]] : graph.graph[s][eid[i]];
    long long cap = e.cap;
    long long rcap = graph.graph[e.to][e.rev].cap;
    e.cap = inf;
    long long f = graph.max_flow(s, t);
    if (mx_st - f >= K) {
      ans.push_back(i);
      mx_st -= f;
    } else {
      e.cap = cap;
      graph.graph[e.to][e.rev].cap = rcap;
      if (y[i] % 2 == 0)
        graph.max_flow(t, i, f);
      else
        graph.max_flow(i, s, f);
    }
  }
  for (long long i = 0; i < (long long)(K); i++) cout << ans[i] + 1 << endl;
  return 0;
}
