#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top,yyy;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
inline int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
inline bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
inline int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]--;
    return 1;
}
inline void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]++;
    return ;
}
inline void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
inline bool dfs(int x)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1);
    if(du[x]!=1)
    {
        Change(x);
        yyy++;
        if(yyy<=m)
            tmp=dfs(x+1);
        yyy--;
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    yyy+=tot;
    if(yyy<=m)
        tmp=dfs(x+1);
    yyy-=tot;
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
inline bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    yyy=0;
    return dfs(1);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        d[i]=i;
    srand(time(0));
    for(int i=1;i<=n*n;i++)
        swap(d[rand()%n+1],d[rand()%n+1]);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[d[i]].x,&P[d[i]].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid;
        else
            r=mid-1;
    }
    print=true;
    check(r);
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top,yyy;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
inline int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
inline bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
inline int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]--;
    return 1;
}
inline void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]++;
    return ;
}
inline void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
inline bool dfs(int x)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1);
    if(du[x]!=1)
    {
        Change(x);
        yyy++;
        if(yyy<=m)
            tmp=dfs(x+1);
        yyy--;
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    yyy+=tot;
    if(yyy<=m)
        tmp=dfs(x+1);
    yyy-=tot;
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
inline bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    yyy=0;
    return dfs(1);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[i].x,&P[i].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    bool flag=false;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid,flag=false;
        else
            r=mid-1,flag=true;
    }
    print=true;
    check(r);
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        du[d[i]]--;
    return 1;
}
void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        du[d[i]]++;
    return ;
}
void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
bool dfs(int x,int y)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1,y);
    if(du[x]!=1)
    {
        Change(x);
        if(y<m)
            tmp=dfs(x+1,y+1);
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    if(y+tot<=m)
        tmp=dfs(x+1,y+tot);
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    return dfs(1,0);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[i].x,&P[i].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    bool flag=false;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid,flag=false;
        else
            r=mid-1,flag=true;
    }
    print=true;
    check(r);
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]--;
    return 1;
}
void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]++;
    return ;
}
void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
bool dfs(int x,int y)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1,y);
    if(du[x]!=1)
    {
        Change(x);
        if(y<m)
            tmp=dfs(x+1,y+1);
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    if(y+tot<=m)
        tmp=dfs(x+1,y+tot);
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    return dfs(1,0);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[i].x,&P[i].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    bool flag=false;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid,flag=false;
        else
            r=mid-1,flag=true;
    }
    print=true;
    check(r);
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top,yyy;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]--;
    return 1;
}
void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]++;
    return ;
}
void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
bool dfs(int x)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1);
    if(du[x]!=1)
    {
        Change(x);
        yyy++;
        if(yyy<=m)
            tmp=dfs(x+1);
        yyy--;
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    yyy+=tot;
    if(yyy<=m)
        tmp=dfs(x+1);
    yyy-=tot;
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    yyy=0;
    return dfs(1);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[i].x,&P[i].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    bool flag=false;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid,flag=false;
        else
            r=mid-1,flag=true;
    }
    print=true;
    check(r);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define pow(_) ((_)*(_))
const int MAXN=1005;
const int MAXM=2*MAXN*MAXN;
int n,k,l;
int x[MAXN],y[MAXN],v[MAXN],dis[MAXN][MAXN];
int tot,d[MAXM],next[MAXM],last[MAXN];
void add(int x,int y)
{
    next[++tot]=last[x];last[x]=tot;d[tot]=y;
}
bool dfs(int x,int k)
{
    if(x>n)
        return 1;
    if(v[x])
        return dfs(x+1,k);
    for(int p=last[x];p;p=next[p])
        k-=!(v[d[p]]++);
    if(k>=0&&dfs(x+1,k))
        return 1;
    v[x]=1;
    int tmp=k;
    for(int p=last[x];p;p=next[p])
        k+=!(--v[d[p]]);
    if(--k>=0&&k>tmp&&dfs(x+1,k))
        return 1;
    v[x]=0;
    return 0;
}
bool check(int mid)
{
    l=0;
    memset(v,0,sizeof(v));
    memset(last,0,sizeof(last));
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if(dis[i][j]>mid)
                add(i,j);
    return dfs(1,k);
}
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&x[i],&y[i]);
    for(int i=1;i<=n;++i)
        for(int j=1;j<=n;++j)
            dis[i][j]=pow(x[i]-x[j])+pow(y[i]-y[j]);
    int l=0,r=pow(32000);
    while(l<r)
    {
        int mid=(l+r)/2;
        if(check(mid))
            r=mid;
        else
            l=mid+1;
    }
    check(r);
    for(int i=1;i<=n&&k;++i)
        if(v[i])
            if(--k)
                printf("%d ",i);
            else
                printf("%d\n",i);
    for(int i=1;i<=n&&k;++i)
        if(!v[i])
            if(--k)
                printf("%d ",i);
            else
                printf("%d\n",i);
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        du[d[i]]--;
    return 1;
}
void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        du[d[i]]++;
    return ;
}
void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
bool dfs(int x,int y)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1,y);
    if(du[x]!=1)
    {
        Change(x);
        if(y<m)
            tmp=dfs(x+1,y+1);
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    if(y+tot<=m)
        tmp=dfs(x+1,y+tot);
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    return dfs(1,0);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[i].x,&P[i].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m*2-1,r=top;
    bool flag=false;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid,flag=false;
        else
            r=mid-1,flag=true;
    }
    print=true;
    check(r);
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top,yyy;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2];
int dq[MAXN],qd[MAXN];
inline int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
inline bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
inline int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]--;
    return 1;
}
inline void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        if(!use[d[i]])
            du[d[i]]++;
    return ;
}
inline void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
inline bool dfs(int x)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",qd[i]);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1);
    if(du[x]!=1)
    {
        Change(x);
        yyy++;
        if(yyy<=m)
            tmp=dfs(x+1);
        yyy--;
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    yyy+=tot;
    if(yyy<=m)
        tmp=dfs(x+1);
    yyy-=tot;
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
inline bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    yyy=0;
    return dfs(1);
}
int main()
{
    scanf("%d%d",&n,&m);
    srand(time(0));
    for(int i=1;i<=n;i++)
        dq[i]=i;
    for(int i=1;i<=n*n;i++)
        swap(dq[rand()%n+1],dq[rand()%n+1]);
    for(int i=1;i<=n;i++)
        qd[dq[i]]=i;
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[dq[i]].x,&P[dq[i]].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid;
        else
            r=mid-1;
    }
    print=true;
    check(r);
    return 0;
}


#include<cstdio>
#include<cstring>
#define Pow(x) ((x)*(x))
#define LL long long
const int MAXN=1005;
const int MAXM=2*MAXN*MAXN;
int n,k,l;
int x[MAXN],y[MAXN],v[MAXN],dis[MAXN][MAXN];
int tot,d[MAXM],next[MAXM],last[MAXN];
void add(int x,int y)
{
    d[++tot]=y;next[tot]=last[x];last[x]=tot;
}
bool dfs(int x,int k)
{
    if(x>n)
        return 1;
    if(v[x])
        return dfs(x+1,k);
    for(int p=last[x];p;p=next[p])
        k-=!v[d[p]]++;
    if(k>=0&&dfs(x+1,k))
        return 1;
    v[x]=1;
    int tmp=k;
    for(int p=last[x];p;p=next[p])
        k+=!--v[d[p]];
    if(--k>=0&&k>tmp&&dfs(x+1,k))
        return 1;
    v[x]=0;
    return 0;
}
bool check(LL mid)
{
    l=0;
    memset(v,0,sizeof(v));
    memset(last,0,sizeof(last));
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if(dis[i][j]>mid)
                add(i,j);
    return dfs(1,k);
}
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&x[i],&y[i]);
    for(int i=1;i<=n;++i)
        for(int j=1;j<=n;++j)
            dis[i][j]=Pow(x[i]-x[j])+Pow(y[i]-y[j]);
    LL l=0,r=1ll<<31;
    while(l<r)
    {
        int mid=(l+r)/2;
        if(check(mid))
            r=mid;
        else
            l=mid+1;
    }
    check(r);
    for(int i=1;i<=n&&k;++i)
        if(v[i])
            printf("%d%s",i,--k?" ":"\n");
    for(int i=1;i<=n&&k;++i)
        if(!v[i])
            printf("%d%s",i,--k?" ":"\n");
    return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define sqr(_) ((_)*(_))
#define LL long long
#define x first
#define y second
#define mp make_pair
using namespace std;
const int MAXN=1005;
typedef pair<int,int> Pair;
Pair P[MAXN],q[MAXN*MAXN];
int du[MAXN],use[MAXN];
int n,m,top;
bool print;
int next[MAXN*MAXN*2],last[MAXN],d[MAXN*MAXN*2],Y;
int Dis(const Pair &x,const Pair &y)
{
    return sqr(x.x-y.x)+sqr(x.y-y.y);
}
bool cmp(const Pair &x,const Pair &y)
{
    return Dis(P[x.x],P[x.y])>Dis(P[y.x],P[y.y]);
}
int Change(int q)
{
    use[q]++;
    if(use[q]>1)
        return 0;
    for(int i=last[q];i;i=next[i])
        du[d[i]]--;
    return 1;
}
void Delete(int q)
{
    use[q]--;
    if(use[q]>1)
        return ;
    for(int i=last[q];i;i=next[i])
        du[d[i]]++;
    return ;
}
void Add(int x,int y)
{
    next[++top]=last[x];last[x]=top;d[top]=y;
}
bool dfs(int x)
{
    if(x==n+1)
    {
        if(print)
        {
            for(int i=1;i<=n;i++)
                if(use[i])
                    printf("%d ",i);
            printf("\n");
        }
        return true;
    }
    bool tmp=false;
    int tot=0;
    if(du[x]==0||use[x])
        return dfs(x+1);
    if(du[x]!=1)
    {
        Change(x);
        Y++;
        if(Y<m)
            tmp=dfs(x+1);
        Y--;
        Delete(x);
    }
    if(tmp)
        return true;
    for(int i=last[x];i;i=next[i])
        tot+=Change(d[i]);
    Y+=tot;
    if(Y<=m)
        tmp=dfs(x+1);
    Y-=tot;
    for(int i=last[x];i;i=next[i])
        Delete(d[i]);
    return tmp;
}
bool check(int edge)
{
    memset(last,0,sizeof(last));
    memset(du,0,sizeof(du));
    top=0;
    for(int i=1;i<=edge;i++)
    {
        Add(q[i].x,q[i].y);
        du[q[i].x]++;
        du[q[i].y]++;
    }
    return dfs(1);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&P[i].x,&P[i].y);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            q[++top]=mp(i,j);
    sort(q+1,q+1+top,cmp);
    int l=m-1,r=top;
    bool flag=false;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))
            l=mid,flag=false;
        else
            r=mid-1,flag=true;
    }
    print=true;
    check(r);
    return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1050;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
/*	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;*/
	if (x == n + 1) return true;
	if (removed[x])
		return dfs(x + 1, rest);

	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]] ++) ++used;
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1; i <= par[x][0]; ++i)
		--removed[par[x][i]];

	if (used == 1) return false;

	if (rest >= 1)
	{
		++removed[x];
		if (dfs(x + 1, rest - 1)) return true;
		--removed[x];
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1005;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
/*	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;*/
	if (x == n + 1) return true;
	if (removed[x] || par[x][0] == 0)
		return dfs(x + 1, rest);

	bool able = true;
	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]])
		{
			++used;
			removed[y] = x;
		}
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (removed[y = par[x][i]] == x)
			removed[y] = 0;

	if (used == 1) return false;

	if (rest >= 1)
	{
		removed[x] = x;
		if (dfs(x + 1, rest - 1)) return true;
		removed[x] = 0;
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	for (r = 1; r <= ck; r += max(1, ck / 5))
		if (check(disp[r])) break;
		else l = r;
	if (!check(disp[r]))
		r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1050;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
/*	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;*/
	if (x == n + 1) return true;
	if (removed[x])
		return dfs(x + 1, rest);

	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]] ++) ++used;
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1; i <= par[x][0]; ++i)
		--removed[par[x][i]];

	if (used <= 1) return false;

	if (rest >= 1)
	{
		++removed[x];
		if (dfs(x + 1, rest - 1)) return true;
		--removed[x];
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1005;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
//	int n_rest = k;
//	for (int i = 1; i <= n; ++i)
//		if (removed[i]) --n_rest;
//	if (n_rest != rest)
//		throw;
	if (x == n + 1) return true;
	if (removed[x] || par[x][0] == 0)
		return dfs(x + 1, rest);

	bool able = true;
	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]])
		{
			++used;
			removed[y] = x;
		}
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (removed[y = par[x][i]] == x)
			removed[y] = 0;

	if (used == 1) return false;

	if (rest >= 1)
	{
		removed[x] = x;
		if (dfs(x + 1, rest - 1)) return true;
		removed[x] = 0;
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1005;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
/*	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;*/
	if (x == n + 1) return true;
	if (removed[x] || par[x][0] == 0)
		return dfs(x + 1, rest);

	bool able = true;
	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]])
		{
			++used;
			removed[y] = x;
		}
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (removed[y = par[x][i]] == x)
			removed[y] = 0;

	if (used == 1) return false;

	if (rest >= 1)
	{
		removed[x] = x;
		if (dfs(x + 1, rest - 1)) return true;
		removed[x] = 0;
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

const int N = 1005;

template <class T> inline T sqr (T x) { return x * x; }

vector<int> par[N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;
	if (x == n + 1) return true;
	if (removed[x]) return dfs(x + 1, rest);
	bool able = true;
	for (int y : par[x])
		if (!removed[y])
			if (!rest--)
			{
				able = false;
				break;
			}
			else removed[y] = x;
	if (able)
		if (dfs(x + 1, rest)) return true;
		else;
	else ++rest;
	for (int y : par[x])
		if (removed[y] == x)
		{
			removed[y] = 0;
			++rest;
		}
	if (!removed[x])
	{
		--rest;
		removed[x] = x;
	}
	if (rest >= 0)
		if (dfs(x + 1, rest)) return true;
	if (removed[x] == x) removed[x] = 0;
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i].clear();
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			if (dis[j][i] > m) par[i].push_back(j);
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1005;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;
	if (x == n + 1) return true;
	if (removed[x] || par[x][0] == 0)
		return dfs(x + 1, rest);

	bool able = true;
	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]])
		{
			++used;
			removed[y] = x;
		}
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (removed[y = par[x][i]] == x)
			removed[y] = 0;

	if (used == 1) return false;

	if (rest >= 1)
	{
		removed[x] = x;
		if (dfs(x + 1, rest - 1)) return true;
		removed[x] = 0;
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	for (r = 1; r <= ck; r += max(1, ck / 5))
		if (check(disp[r])) break;
		else l = r;
	if (!check(disp[r]))
		r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1005;

template <class T> inline T sqr (T x) { return x * x; }

int par[N][N];
int removed[N], n, k;
struct point { int x, y; } P[N];
int disp[N * N], dis[N][N];

int dfs (int x, int rest)
{
/*	int n_rest = k;
	for (int i = 1; i <= n; ++i)
		if (removed[i]) --n_rest;
	if (n_rest != rest)
		throw;*/
	if (x == n + 1) return true;
	if (removed[x] || par[x][0] == 0)
		return dfs(x + 1, rest);

	int used = 0;
	for (int i = 1, y; i <= par[x][0]; ++i)
		if (!removed[y = par[x][i]] ++) ++used;
	if (rest >= used && dfs(x + 1, rest - used)) return true;
	for (int i = 1; i <= par[x][0]; ++i)
		--removed[par[x][i]];

//	if (used == 1) return false;

	if (rest >= 1)
	{
		++removed[x];
		if (dfs(x + 1, rest - 1)) return true;
		--removed[x];
	}
	return false;
}

bool check (int m)
{
	for (int i = 1; i <= n; ++i)
	{
		par[i][0] = 0;
		removed[i] = 0;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if (dis[j][i] > m) par[i][++par[i][0]] = j;
	return dfs(1, k);
}

int main ()
{
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &P[i].x, &P[i].y);
	int ck = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			disp[++ck] = dis[i][j] = dis[j][i] = sqr(P[i].x - P[j].x) + sqr(P[i].y - P[j].y);
	sort(disp + 1, disp + 1 + ck);
	ck = unique(disp + 1, disp + 1 + ck) - (disp + 1);
	int l = 0, r = ck;
	while (l + 1 < r)
	{
		int m = (l + r) >> 1;
		if (check(disp[m])) r = m;
		else l = m;
	}
	if (!check(disp[r]))
	   throw;
#ifdef LOCAL
	printf("%d\n", r);
#endif
	for (int i = 1; i <= n; ++i)
		if (removed[i])
		{
			--k;
			printf("%d ", i);
		}
	for (int i = 1; i <= n && k > 0; ++i)
		if (!removed[i])
		{
			--k;
			printf("%d ", i);
		}
	printf("\n");
	return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int gg[1000];
int vnum[1000];
int rc[1000];
int r[1000][1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int mr[500000];
int sz=0,k,best=0,n,tmark=10;
int x[1000];
int y[1000];
int zzots;
bool fucke(int i,int mvc,int md) {
    if (i>=mvc) {
        int t=0;
        while (md>0) {
            if (!m[t]) {
                m[t]=1;
                ud[--md]=t;
            }
            ++t;
        }
        return true;
    }
    int v=vnum[i];
    if ((zz[v]==0)||(m[v])) {
        return fucke(i+1,mvc,md);
    }
    if (md==0) return false;
//    if (zz[v]!=1)
    {
        for (int j=0;j<rc[v];++j) {
           --zz[r[v][j]];
        }
        m[v]=1;
        ud[md-1]=v;
        if (v==626) {
            clog << "huiin " << endl;
        }

        if (fucke(i+1,mvc,md-1)) return true;
        if (v==626) {
            clog << "huiout " << endl;
        }
        m[v]=0;
        for (int j=0;j<rc[v];++j) {
            ++zz[r[v][j]];
        }
    }
    if (zz[v]<=md) {
        int omd=md;
        for (int j=0;j<rc[v];++j) {
            if (!m[r[v][j]]) {
                int dd=r[v][j];
                if (dd==626) {
                    clog << "pizdain " << endl;
                }
                for (int k=0;k<rc[dd];++k) {
                    --zz[r[dd][k]];
                }
                ud[--md]=dd;
                m[dd]=1;
            }
        }
        if (fucke(i+1,mvc,md)) return true;
        while (omd>md) {
            int dd=ud[--omd];
            if (dd==626) {
                clog << "pizdaout" << endl;
            }
            for (int k=0;k<rc[dd];++k) {
                 ++zz[r[dd][k]];
            }
            m[dd]=0;
        }
    }
    return false;
}

bool check(int x){
    ++tmark;
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
 /*   for (int i=0;i<x;++i) {
        ++zz[f2[i]];
        ++zz[s2[i]];
        if ((zz[f2[i]]>k)&&(!m[f2[i]])) {
            if (uk==0) return false;
            ud[--uk]=f2[i];
            m[f2[i]]=1;
        }
        if ((zz[s2[i]]>k)&&(!m[s2[i]])) {
            if (uk==0) return false;
            ud[--uk]=s2[i];
            m[s2[i]]=1;
        }
    }

   while (1) {
        bool bo=false;
        for (int i=0;i<x;++i) {
            if ((m[s2[i]]||m[f2[i]])&&(mr[i]!=tmark)) {
                --zz[f2[i]];
                --zz[s2[i]];
                mr[i]=tmark;
            }
        }
        for (int i=0;i<x;++i) {
           if (!(m[s2[i]]||m[f2[i]])) {
               if (zz[f2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=s2[i];
                   m[s2[i]]=1;
               } else if (zz[s2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=f2[i];
                   m[f2[i]]=1;
               }
           }
        }
        if (!bo) break;
    }*/
    int uk2=0;
    memset(zz,0,sizeof(zz));
    memset(rc,0,sizeof(rc));
    memset(gg,0,sizeof(gg));
    int vc=0;
    for (int i=0;i<x;++i) {
        if ((!(m[s2[i]]))&&(!(gg[s2[i]]))) {
            gg[s2[i]]=1;
            vnum[vc++]=s2[i];
        }
        if ((!(m[f2[i]]))&&(!(gg[f2[i]]))) {
            gg[f2[i]]=1;
            vnum[vc++]=f2[i];
        }
        if (!(m[s2[i]]||m[f2[i]])) {
            r[s2[i]][rc[s2[i]]++]=f2[i];
            r[f2[i]][rc[f2[i]]++]=s2[i];
            ++zz[f2[i]];
            ++zz[s2[i]];
        }
    }
    bool b=(fucke(0,vc,uk));
    if ((b)&&(x>best)) {
          best=x;
          memcpy(fu,ud,120);
    }
    return b;
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
    memcpy(f2,f,sizeof(f));
    memcpy(s2,s,sizeof(s));
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    clog << best << endl;
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int sz=0,k,best=0,n;
int x[1000];
int y[1000];
int zzots;
bool fucke(int ps,int o,int mx) {
    int orps=ps;
    while ((ps<mx)&&((m[f[ps]])||(m[s[ps]]))) {
        zz[f[ps]]--;
        zz[s[ps]]--;
        ++ps;
    }
    if (ps>=mx) {
        if (ps>best) {
            best=ps;
            memcpy(fu,ud,120);
        }
        return true;
    }
    if (o==0) {
        while (orps<ps) {
            zz[f[orps]]++;
            zz[s[orps]]++;
            orps++;
        }
        return false;
    }
    zz[f[ps]]--;
    zz[s[ps]]--;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[f[ps]]=0;
        if ((zz[f[ps]]<o)&&(zz[s[ps]]))
        {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[s[ps]]=0;
        if ((zz[s[ps]]<o)&&(zz[f[ps]]))
        {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[f[ps]]=0;
        }
    }
    while (orps<=ps) {
        zz[f[orps]]++;
        zz[s[orps]]++;
        orps++;
    }
    return false;
}

bool check(int x){
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
    for (int i=0;i<x;++i) {
        ++zz[f[i]];
        ++zz[s[i]];
        if ((zz[f[i]]>k)&&(!m[f[i]])) {
            if (uk==0) return false;
            ud[--uk]=f[i];
            m[f[i]]=1;
        }
        if ((zz[s[i]]>k)&&(!m[s[i]])) {
            if (uk==0) return false;
            ud[--uk]=s[i];
            m[s[i]]=1;
        }

    }
    return (fucke(0,uk,x));
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int mr[500000];
int sz=0,k,best=0,n,tmark=10;
int x[1000];
int y[1000];
int zzots;
bool fucke(int ps,int o,int mx) {
    int orps=ps;
    while ((ps<mx)&&((m[f[ps]])||(m[s[ps]]))) {
        zz[f[ps]]--;
        zz[s[ps]]--;
        ++ps;
    }
    if (ps>=mx) {
        return true;
    }
    if (o==0) {
        while (orps<ps) {
            zz[f[orps]]++;
            zz[s[orps]]++;
            orps++;
        }
        return false;
    }
    zz[f[ps]]--;
    zz[s[ps]]--;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[f[ps]]=0;
        if ((zz[f[ps]]<o)&&(zz[s[ps]]))
        {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[s[ps]]=0;
//        if ((zz[s[ps]]<o)&&(zz[f[ps]]))
        {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[f[ps]]=0;
        }
    }
    while (orps<=ps) {
        zz[f[orps]]++;
        zz[s[orps]]++;
        orps++;
    }
    return false;
}

bool check(int x){
    ++tmark;
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
    for (int i=0;i<x;++i) {
        ++zz[f2[i]];
        ++zz[s2[i]];
        if ((zz[f2[i]]>k)&&(!m[f2[i]])) {
            if (uk==0) return false;
            ud[--uk]=f2[i];
            m[f2[i]]=1;
        }
        if ((zz[s2[i]]>k)&&(!m[s2[i]])) {
            if (uk==0) return false;
            ud[--uk]=s2[i];
            m[s2[i]]=1;
        }
    }

   while (1) {
        bool bo=false;
        for (int i=0;i<x;++i) {
            if ((m[s2[i]]||m[f2[i]])&&(mr[i]!=tmark)) {
                --zz[f2[i]];
                --zz[s2[i]];
                mr[i]=tmark;
            }
        }
        for (int i=0;i<x;++i) {
           if (!(m[s2[i]]||m[f2[i]])) {
               if (zz[f2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=s2[i];
                   m[s2[i]]=1;
               } else if (zz[s2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=f2[i];
                   m[f2[i]]=1;
               }
           }
        }
        if (!bo) break;
    }
    int uk2=0;
    memset(zz,0,sizeof(zz));
    for (int i=0;i<x;++i) {
        if (!(m[s2[i]]||m[f2[i]])) {
            f[uk2]=f2[i];
            s[uk2]=s2[i];
            ++zz[f[uk2]];
            ++zz[s[uk2]];
            ++uk2;
        }
    }
    bool b=(fucke(0,uk,uk2));
    if ((b)&&(x>best)) {
          best=x;
          memcpy(fu,ud,120);
    }
    return b;
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
    memcpy(f2,f,sizeof(f));
    memcpy(s2,s,sizeof(s));
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


// Please, please don't hack it!

#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int sz=0,k,best=0,n;
int x[1000];
int y[1000];
int zzots;
void fucke(int ps,int o) {
    while ((ps<sz)&&((m[f[ps]])||(m[s[ps]]))) ++ps;
    if (ps>=sz) {
        for (int i=0;i<k;++i) cout << ud[i]+1 << " ";
        cout << endl;
        _exit(0);
    }
    if (o==0) {
        if (ps>best) {
            best=ps;
            memcpy(fu,ud,120);
        }
        return;
    }
    ++zzots;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        fucke(ps+1,o-1);
        m[f[ps]]=0;
        if (zzots<40000000) {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            fucke(ps+1,o-1);
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        fucke(ps+1,o-1);
        m[s[ps]]=0;
        if (zzots<40000000) {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            fucke(ps+1,o-1);
            m[f[ps]]=0;
        }
    }
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}
int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
        zz[f[i]]+=sz-i+1;
        zz[s[i]]+=sz-i+1;
    }
    fucke(0,k);
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


// Please, please don't hack it!

#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int sz=0,k,best=0,n;
int x[1000];
int y[1000];
int zzots;
void fucke(int ps,int o) {
    while ((ps<sz)&&((m[f[ps]])||(m[s[ps]]))) ++ps;
    if (ps>=sz) {
        for (int i=0;i<k;++i) cout << ud[i]+1 << " ";
        cout << endl;
        _exit(0);
    }
    if (o==0) {
        if (ps>best) {
            best=ps;
            memcpy(fu,ud,120);
        }
        return;
    }
    ++zzots;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        fucke(ps+1,o-1);
        m[f[ps]]=0;
        if (zzots<30000000) {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            fucke(ps+1,o-1);
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        fucke(ps+1,o-1);
        m[s[ps]]=0;
        if (zzots<30000000) {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            fucke(ps+1,o-1);
            m[f[ps]]=0;
        }
    }
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}
int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
        zz[f[i]]+=sz-i+1;
        zz[s[i]]+=sz-i+1;
    }
    fucke(0,k);
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int gg[1000];
int vnum[1000];
int rc[1000];
int r[1000][1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int mr[500000];
int sz=0,k,best=0,n,tmark=10;
int x[1000];
int y[1000];
int zzots;
bool fucke(int i,int mvc,int md) {
    if (i>=mvc) {
        int t=0;
        while (md>0) {
            if (!m[t]) {
                m[t]=1;
                ud[--md]=t;
            }
            ++t;
        }
        return true;
    }
    int v=vnum[i];
    if ((zz[v]==0)||(m[v])) {
        return fucke(i+1,mvc,md);
    }
    if (md==0) return false;
    if (zz[v]!=1) {
        for (int j=0;j<rc[v];++j) {
           --zz[r[v][j]];
        }
        m[v]=1;
        ud[md-1]=v;
        if (v==626) {
            clog << "huiin " << endl;
        }

        if (fucke(i+1,mvc,md-1)) return true;
        if (v==626) {
            clog << "huiout " << endl;
        }
        m[v]=0;
        for (int j=0;j<rc[v];++j) {
            ++zz[r[v][j]];
        }
    }
    if (zz[v]<=md) {
        int omd=md;
        for (int j=0;j<rc[v];++j) {
            if (!m[r[v][j]]) {
                int dd=r[v][j];
                if (dd==626) {
                    clog << "pizdain " << endl;
                }
                for (int k=0;k<rc[dd];++k) {
                    --zz[r[dd][k]];
                }
                ud[--md]=dd;
                m[dd]=1;
            }
        }
        if (fucke(i+1,mvc,md)) return true;
        while (omd>md) {
            int dd=ud[--omd];
            if (dd==626) {
                clog << "pizdaout" << endl;
            }
            for (int k=0;k<rc[dd];++k) {
                 ++zz[r[dd][k]];
            }
            m[dd]=0;
        }
    }
    return false;
}

bool check(int x){
    ++tmark;
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
 /*   for (int i=0;i<x;++i) {
        ++zz[f2[i]];
        ++zz[s2[i]];
        if ((zz[f2[i]]>k)&&(!m[f2[i]])) {
            if (uk==0) return false;
            ud[--uk]=f2[i];
            m[f2[i]]=1;
        }
        if ((zz[s2[i]]>k)&&(!m[s2[i]])) {
            if (uk==0) return false;
            ud[--uk]=s2[i];
            m[s2[i]]=1;
        }
    }

   while (1) {
        bool bo=false;
        for (int i=0;i<x;++i) {
            if ((m[s2[i]]||m[f2[i]])&&(mr[i]!=tmark)) {
                --zz[f2[i]];
                --zz[s2[i]];
                mr[i]=tmark;
            }
        }
        for (int i=0;i<x;++i) {
           if (!(m[s2[i]]||m[f2[i]])) {
               if (zz[f2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=s2[i];
                   m[s2[i]]=1;
               } else if (zz[s2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=f2[i];
                   m[f2[i]]=1;
               }
           }
        }
        if (!bo) break;
    }*/
    int uk2=0;
    memset(zz,0,sizeof(zz));
    memset(rc,0,sizeof(rc));
    memset(gg,0,sizeof(gg));
    int vc=0;
    for (int i=0;i<x;++i) {
        if ((!(m[s2[i]]))&&(!(gg[s2[i]]))) {
            gg[s2[i]]=1;
            vnum[vc++]=s2[i];
        }
        if ((!(m[f2[i]]))&&(!(gg[f2[i]]))) {
            gg[f2[i]]=1;
            vnum[vc++]=f2[i];
        }
        if (!(m[s2[i]]||m[f2[i]])) {
            r[s2[i]][rc[s2[i]]++]=f2[i];
            r[f2[i]][rc[f2[i]]++]=s2[i];
            ++zz[f2[i]];
            ++zz[s2[i]];
        }
    }
    bool b=(fucke(0,vc,uk));
    if ((b)&&(x>best)) {
          best=x;
          memcpy(fu,ud,120);
    }
    return b;
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
    memcpy(f2,f,sizeof(f));
    memcpy(s2,s,sizeof(s));
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    clog << best << endl;
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int mr[500000];
int sz=0,k,best=0,n,tmark=10;
int x[1000];
int y[1000];
int zzots;
bool fucke(int ps,int o,int mx) {
    int orps=ps;
    while ((ps<mx)&&((m[f[ps]])||(m[s[ps]]))) {
        zz[f[ps]]--;
        zz[s[ps]]--;
        ++ps;
    }
    if (ps>=mx) {
        return true;
    }
    if (o==0) {
        while (orps<ps) {
            zz[f[orps]]++;
            zz[s[orps]]++;
            orps++;
        }
        return false;
    }
    zz[f[ps]]--;
    zz[s[ps]]--;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[f[ps]]=0;
 //       if ((zz[f[ps]]<o)&&(zz[s[ps]]))
        {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[s[ps]]=0;
//        if ((zz[s[ps]]<o)&&(zz[f[ps]]))
        {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[f[ps]]=0;
        }
    }
    while (orps<=ps) {
        zz[f[orps]]++;
        zz[s[orps]]++;
        orps++;
    }
    return false;
}

bool check(int x){
    ++tmark;
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
    for (int i=0;i<x;++i) {
        ++zz[f2[i]];
        ++zz[s2[i]];
        if ((zz[f2[i]]>k)&&(!m[f2[i]])) {
            if (uk==0) return false;
            ud[--uk]=f2[i];
            m[f2[i]]=1;
        }
        if ((zz[s2[i]]>k)&&(!m[s2[i]])) {
            if (uk==0) return false;
            ud[--uk]=s2[i];
            m[s2[i]]=1;
        }
    }

   while (1) {
        bool bo=false;
        for (int i=0;i<x;++i) {
            if ((m[s2[i]]||m[f2[i]])&&(mr[i]!=tmark)) {
                --zz[f2[i]];
                --zz[s2[i]];
                mr[i]=tmark;
            }
        }
        for (int i=0;i<x;++i) {
           if (!(m[s2[i]]||m[f2[i]])) {
               if (zz[f2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=s2[i];
                   m[s2[i]]=1;
               } else if (zz[s2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=f2[i];
                   m[f2[i]]=1;
               }
           }
        }
        if (!bo) break;
    }
    int uk2=0;
    memset(zz,0,sizeof(zz));
    for (int i=0;i<x;++i) {
        if (!(m[s2[i]]||m[f2[i]])) {
            f[uk2]=f2[i];
            s[uk2]=s2[i];
            ++zz[f[uk2]];
            ++zz[s[uk2]];
            ++uk2;
        }
    }
    bool b=(fucke(0,uk,uk2));
    if ((b)&&(x>best)) {
          best=x;
          memcpy(fu,ud,120);
    }
    return b;
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
    memcpy(f2,f,sizeof(f));
    memcpy(s2,s,sizeof(s));
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


// Please, please don't hack it!

#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int sz=0,k,best=0,n;
int x[1000];
int y[1000];
int zzots;
void fucke(int ps,int o) {
    while ((ps<sz)&&((m[f[ps]])||(m[s[ps]]))) ++ps;
    if (ps>=sz) {
        for (int i=0;i<k;++i) cout << ud[i]+1 << " ";
        cout << endl;
        _exit(0);
    }
    if (o==0) {
        if (ps>best) {
            best=ps;
            memcpy(fu,ud,120);
        }
        return;
    }
    ++zzots;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        fucke(ps+1,o-1);
        m[f[ps]]=0;
        if (zzots<50000000) {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            fucke(ps+1,o-1);
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        fucke(ps+1,o-1);
        m[s[ps]]=0;
        if (zzots<50000000) {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            fucke(ps+1,o-1);
            m[f[ps]]=0;
        }
    }
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}
int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
        zz[f[i]]+=sz-i+1;
        zz[s[i]]+=sz-i+1;
    }
    fucke(0,k);
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


// Please, please don't hack it!

#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int sz=0,k,best=0,n;
int x[1000];
int y[1000];
int zzots;
void fucke(int ps,int o) {
    while ((ps<sz)&&((m[f[ps]])||(m[s[ps]]))) ++ps;
    if (ps>=sz) {
        for (int i=0;i<k;++i) cout << ud[i]+1 << " ";
        cout << endl;
        _exit(0);
    }
    if (o==0) {
        if (ps>best) {
            best=ps;
            memcpy(fu,ud,120);
        }
        return;
    }
    ++zzots;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        fucke(ps+1,o-1);
        m[f[ps]]=0;
        if (zzots<10000000) {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            fucke(ps+1,o-1);
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        fucke(ps+1,o-1);
        m[s[ps]]=0;
        if (zzots<20000000) {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            fucke(ps+1,o-1);
            m[f[ps]]=0;
        }
    }
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}
int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
        zz[f[i]]+=sz-i+1;
        zz[s[i]]+=sz-i+1;
    }
    fucke(0,k);
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int gg[1000];
int vnum[1000];
int rc[1000];
int r[1000][1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int mr[500000];
int sz=0,k,best=0,n,tmark=10;
int x[1000];
int y[1000];
int zzots;
bool fucke(int i,int mvc,int md) {
    if (i>=mvc) {
        int t=0;
        while (md>0) {
            if (!m[t]) {
                m[t]=1;
                ud[--md]=t;
            }
            ++t;
        }
        return true;
    }
    int v=vnum[i];
    if ((zz[v]==0)||(m[v])) {
        return fucke(i+1,mvc,md);
    }
    if (md==0) return false;
    if (zz[v]!=1) {
        for (int j=0;j<rc[v];++j) {
           --zz[r[v][j]];
        }
        m[v]=1;
        ud[md-1]=v;
        if (v==626) {
            clog << "huiin " << endl;
        }

        if (fucke(i+1,mvc,md-1)) return true;
        if (v==626) {
            clog << "huiout " << endl;
        }
        m[v]=0;
        for (int j=0;j<rc[v];++j) {
            ++zz[r[v][j]];
        }
    }
    if (zz[v]<=md) {
        int omd=md;
        for (int j=0;j<rc[v];++j) {
            if (!m[r[v][j]]) {
                int dd=r[v][j];
                if (dd==626) {
                    clog << "pizdain " << endl;
                }
                for (int k=0;k<rc[dd];++k) {
                    --zz[r[dd][k]];
                }
                ud[--md]=dd;
                m[dd]=1;
            }
        }
        if (fucke(i+1,mvc,md)) return true;
        while (omd>md) {
            int dd=ud[--omd];
            if (dd==626) {
                clog << "pizdaout" << endl;
            }
            for (int k=0;k<rc[dd];++k) {
                 ++zz[r[dd][k]];
            }
            m[dd]=0;
        }
    }
    return false;
}

bool check(int x){
    ++tmark;
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
    for (int i=0;i<x;++i) {
        ++zz[f2[i]];
        ++zz[s2[i]];
        if ((zz[f2[i]]>k)&&(!m[f2[i]])) {
            if (uk==0) return false;
            ud[--uk]=f2[i];
            m[f2[i]]=1;
        }
        if ((zz[s2[i]]>k)&&(!m[s2[i]])) {
            if (uk==0) return false;
            ud[--uk]=s2[i];
            m[s2[i]]=1;
        }
    }

   while (1) {
        bool bo=false;
        for (int i=0;i<x;++i) {
            if ((m[s2[i]]||m[f2[i]])&&(mr[i]!=tmark)) {
                --zz[f2[i]];
                --zz[s2[i]];
                mr[i]=tmark;
            }
        }
        for (int i=0;i<x;++i) {
           if (!(m[s2[i]]||m[f2[i]])) {
               if (zz[f2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=s2[i];
                   m[s2[i]]=1;
               } else if (zz[s2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=f2[i];
                   m[f2[i]]=1;
               }
           }
        }
        if (!bo) break;
    }
    int uk2=0;
    memset(zz,0,sizeof(zz));
    memset(rc,0,sizeof(rc));
    memset(gg,0,sizeof(gg));
    int vc=0;
    for (int i=0;i<x;++i) {
        if ((!(m[s2[i]]))&&(!(gg[s2[i]]))) {
            gg[s2[i]]=1;
            vnum[vc++]=s2[i];
        }
        if ((!(m[f2[i]]))&&(!(gg[f2[i]]))) {
            gg[f2[i]]=1;
            vnum[vc++]=f2[i];
        }
        if (!(m[s2[i]]||m[f2[i]])) {
            r[s2[i]][rc[s2[i]]++]=f2[i];
            r[f2[i]][rc[f2[i]]++]=s2[i];
            ++zz[f2[i]];
            ++zz[s2[i]];
        }
    }
    bool b=(fucke(0,vc,uk));
    if ((b)&&(x>best)) {
          best=x;
          memcpy(fu,ud,120);
    }
    return b;
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
    memcpy(f2,f,sizeof(f));
    memcpy(s2,s,sizeof(s));
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    clog << best << endl;
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include <iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int m[1000];
int ud[30];
int fu[30];
int zz[1000];
int f[500000];
int s[500000];
int dd[500000];
int f2[500000];
int s2[500000];
int dd2[500000];
int nn[500000];
int mr[500000];
int sz=0,k,best=0,n,tmark=10;
int x[1000];
int y[1000];
int zzots;
bool fucke(int ps,int o,int mx) {
    int orps=ps;
    while ((ps<mx)&&((m[f[ps]])||(m[s[ps]]))) {
        zz[f[ps]]--;
        zz[s[ps]]--;
        ++ps;
    }
    if (ps>=mx) {
        return true;
    }
    if (o==0) {
        while (orps<ps) {
            zz[f[orps]]++;
            zz[s[orps]]++;
            orps++;
        }
        return false;
    }
    zz[f[ps]]--;
    zz[s[ps]]--;
    if (zz[f[ps]]>zz[s[ps]]) {
        ud[o-1]=f[ps];
        m[f[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[f[ps]]=0;
        if ((zz[f[ps]]<o)&&(zz[s[ps]]))
        {
            m[s[ps]]=1;
            ud[o-1]=s[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[s[ps]]=0;
        }
    } else {
        ud[o-1]=s[ps];
        m[s[ps]]=1;
        if (fucke(ps+1,o-1,mx)) return true;
        m[s[ps]]=0;
        if ((zz[s[ps]]<o)&&(zz[f[ps]]))
        {
            m[f[ps]]=1;
            ud[o-1]=f[ps];
            if (fucke(ps+1,o-1,mx)) return true;
            m[f[ps]]=0;
        }
    }
    while (orps<=ps) {
        zz[f[orps]]++;
        zz[s[orps]]++;
        orps++;
    }
    return false;
}

bool check(int x){
    ++tmark;
    memset(zz,0,sizeof(zz));
    memset(m,0,sizeof(m));
    int uk=k;
    for (int i=0;i<x;++i) {
        ++zz[f2[i]];
        ++zz[s2[i]];
        if ((zz[f2[i]]>k)&&(!m[f2[i]])) {
            if (uk==0) return false;
            ud[--uk]=f2[i];
            m[f2[i]]=1;
        }
        if ((zz[s2[i]]>k)&&(!m[s2[i]])) {
            if (uk==0) return false;
            ud[--uk]=s2[i];
            m[s2[i]]=1;
        }
    }

   while (1) {
        bool bo=false;
        for (int i=0;i<x;++i) {
            if ((m[s2[i]]||m[f2[i]])&&(mr[i]!=tmark)) {
                --zz[f2[i]];
                --zz[s2[i]];
                mr[i]=tmark;
            }
        }
        for (int i=0;i<x;++i) {
           if (!(m[s2[i]]||m[f2[i]])) {
               if (zz[f2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=s2[i];
                   m[s2[i]]=1;
               } else if (zz[s2[i]]==1) {
                   if (uk==0) return false;
                   bo=true;
                   ud[--uk]=f2[i];
                   m[f2[i]]=1;
               }
           }
        }
        if (!bo) break;
    }
    int uk2=0;
    for (int i=0;i<x;++i) {
        if (!(m[s2[i]]||m[f2[i]])) {
            f[uk2]=f2[i];
            s[uk2]=s2[i];
            ++uk2;
        }
    }
    bool b=(fucke(0,uk,uk2));
    if ((b)&&(x>best)) {
          best=x;
          memcpy(fu,ud,120);
    }
    return b;
}

bool lss(int i,int j){
    return (dd2[i]>dd2[j]);
}

int main()
{
    cin >> n >> k;
    for (int i=0;i<n;++i) cin >> x[i] >> y[i];
    for (int i=0;i<n;++i)
        for (int j=i+1;j<n;++j) {
            f2[sz]=i;
            s2[sz]=j;
            dd2[sz]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
            nn[sz]=sz;
            ++sz;
        }
    sort(nn,nn+sz,lss);
    for (int i=0;i<sz;++i) {
        f[i]=f2[nn[i]];
        s[i]=s2[nn[i]];
        dd[i]=dd2[nn[i]];
    }
    memcpy(f2,f,sizeof(f));
    memcpy(s2,s,sizeof(s));
//    check(3);
    int l=0,r=sz;
    while (r-l>1) {
        int t=(l+r)/2;
        if (check(t)) l=t; else r=t;
    }
    for (int i=0;i<k;++i) cout << fu[i]+1 << " ";
    cout << endl;
    return 0;
}


#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
#include<map>
#include<algorithm>
using namespace std;

    bool flag[20200];
    int shu,e,du[20920],sz[2022],mid,ans,bian[1001*1001],tou[2020],hj[1001*1001],fangan[23020],n,k,i,x[2000],y[2000],j,dis[1001][1001],k1;
    long long right1,left1;

int delete1(int i)
{
    int sum=0,now=tou[i];
    while (now!=0)
    {
        if (sz[bian[now]]==2)
        {
            du[bian[now]]--;
            du[i]--;
            sum++;
        }
        now=hj[now];
    }
    return sum;
}

void bu(int i)
{
    int now=tou[i];
    while (now)
    {
        if (sz[bian[now]]==2)
        {
            du[bian[now]]++;
            du[i]++;
        }
        now=hj[now];
    }
}

bool dfs(int i,int k2,int shu)
{
    fangan[0]=k2;
    int k1=k2;
    if (i>n)
    {
        if (k2<=k) return true;
        return false;
    }
    if (k2>k) return false;
    if (shu==0) return true;
    int tmp,now;
    if (sz[i]==0||sz[i]==1) return dfs(i+1,k2,shu);
    if (du[i]==0) {sz[i]=1;if (dfs(i+1,k2,shu)) return true;sz[i]=2;return false;}
    {
        sz[i]=1;
        tmp=shu-delete1(i);
        now=tou[i];
        while (now!=0)
        {
            if (sz[bian[now]]==2)
            {
                k2++;
                fangan[k2]=bian[now];
                sz[fangan[k2]]=0;
                tmp-=delete1(fangan[k2]);
            }
            now=hj[now];
        }
        if (dfs(i+1,k2,tmp)) return true;
        for (tmp=k2;tmp>=k1+1;tmp--) {sz[fangan[tmp]]=2;bu(fangan[tmp]);}
        sz[i]=2;
        bu(i);
        k2=k1;
    }

        if (du[i]>1)
        {

          sz[i]=0;
          tmp=shu-delete1(i);
          fangan[k2+1]=i;
          if (dfs(i+1,k2+1,tmp)) return true;
          sz[i]=2;
          bu(i);
        }

    return false;
}

void cal(int mid)
{
     k=k1;
     for (i=1;i<=n;i++) sz[i]=2;
     e=0;shu=0;
     for (i=1;i<=n;i++)
     {
         du[i]=0;tou[i]=0;
     }
     for (i=1;i<=n;i++)
        for (j=1;j<=n;j++)
         {
          if (i==j) continue;
          if (dis[i][j]>mid)
          {
              e++;bian[e]=j;hj[e]=tou[i];tou[i]=e;du[i]++;du[j]++;shu++;
          }
         }
     fangan[0]=0;
     for (i=1;i<=n;i++) if (du[i]>k)
     {
         sz[i]=0;shu-=delete1(i);k--;
         fangan[0]++;fangan[fangan[0]]=i;
     }
     if (dfs(1,fangan[0],shu))
     {
         ans=(long long )mid;right1=((long long )mid-1);
     }else left1=mid+1;
}
int main()
{
  //  freopen("a.in","r",stdin);
 cin>>n>>k;
 for (i=1;i<=n;i++) cin>>x[i]>>y[i];
 for (i=1;i<=n;i++)
    for (j=1;j<=n;j++)
 {
     if (i==j) continue;
     dis[i][j]=abs(x[i]-x[j])+abs(y[i]-y[j]);
 }
 k1=k;
 left1=0;right1=2147483647;
 while (left1<=right1)
 {
     mid=int((left1+right1)/2);
     cal(mid);
 }
 mid=ans;

 cal(mid);
 for (i=1;i<=fangan[0];i++) {flag[fangan[i]]=true;cout<<fangan[i]<<" ";}
 mid=0;
 for (i=1;i<=n;i++) if (!flag[fangan[i]])
 {
     cout<<i<<" ";
     mid++;
     if (fangan[0]+mid==k1) return 0;
 }
}


#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
#include<map>
#include<algorithm>
using namespace std;

    bool flag[20200];
    int shu,e,du[20920],sz[2022],mid,ans,bian[1001*1001],tou[2020],hj[1001*1001],fangan[23020],n,k,i,x[2000],y[2000],j,dis[1001][1001],k1;
    long long right1,left1;

int delete1(int i)
{
    int sum=0,now=tou[i];
    while (now!=0)
    {
        if (sz[bian[now]]==2)
        {
            du[bian[now]]--;
            du[i]--;
            sum++;
        }
        now=hj[now];
    }
    return sum;
}

void bu(int i)
{
    int now=tou[i];
    while (now)
    {
        if (sz[bian[now]]==2)
        {
            du[bian[now]]++;
            du[i]++;
        }
        now=hj[now];
    }
}

bool dfs(int i,int k2,int shu)
{
    fangan[0]=k2;
    int k1=k2;
    if (i>n)
    {
        if (k2<=k) return true;
        return false;
    }
    if (k2>k) return false;
    if (shu==0) return true;
    int tmp,now;
    if (sz[i]==0||sz[i]==1) return dfs(i+1,k2,shu);
    if (du[i]==0) {sz[i]=1;if (dfs(i+1,k2,shu)) return true;sz[i]=2;return false;}
    {
        sz[i]=1;
        tmp=shu-delete1(i);
        now=tou[i];
        while (now!=0)
        {
            if (sz[bian[now]]==2)
            {
                k2++;
                fangan[k2]=bian[now];
                sz[fangan[k2]]=0;
                tmp-=delete1(fangan[k2]);
            }
            now=hj[now];
        }
        if (dfs(i+1,k2,tmp)) return true;
        for (tmp=k2;tmp>=k1+1;tmp--) {sz[fangan[tmp]]=2;bu(fangan[tmp]);}
        sz[i]=2;
        bu(i);
        k2=k1;
    }

        if (du[i]>1)
        {

          sz[i]=0;
          tmp=shu-delete1(i);
          fangan[k2+1]=i;
          if (dfs(i+1,k2+1,tmp)) return true;
          sz[i]=2;
          bu(i);
        }

    return false;
}

void cal(int mid)
{
     k=k1;
     for (i=1;i<=n;i++) sz[i]=2;
     e=0;shu=0;
     for (i=1;i<=n;i++)
     {
         du[i]=0;tou[i]=0;
     }
     for (i=1;i<=n;i++)
        for (j=1;j<=n;j++)
         {
          if (i==j) continue;
          if (dis[i][j]>mid)
          {
              e++;bian[e]=j;hj[e]=tou[i];tou[i]=e;du[i]++;du[j]++;shu++;
          }
         }
     fangan[0]=0;
     for (i=1;i<=n;i++) if (du[i]>k)
     {
         sz[i]=0;shu-=delete1(i);k--;
         fangan[0]++;fangan[fangan[0]]=i;
     }
     if (dfs(1,fangan[0],shu))
     {
         ans=(long long )mid;right1=((long long )mid-1);
     }else left1=mid+1;
}
int main()
{
  //  freopen("a.in","r",stdin);
 cin>>n>>k;
 for (i=1;i<=n;i++) cin>>x[i]>>y[i];
 for (i=1;i<=n;i++)
    for (j=1;j<=n;j++)
 {
     if (i==j) continue;
     dis[i][j]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
 }
 k1=k;
 left1=0;right1=2147483647;
 while (left1<=right1)
 {
     mid=int((left1+right1)/2);
     cal(mid);
 }
 mid=ans;
 cal(mid);
 //cout<<mid<<endl;
 for (i=1;i<=fangan[0];i++) {flag[fangan[i]]=true;cout<<fangan[i]<<" ";}
 mid=0;
 for (i=1;i<=n;i++) if (!flag[fangan[i]])
 {
     cout<<i<<" ";
     mid++;
     if (fangan[0]+mid==k1) return 0;
 }
}


#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
#include<map>
#include<algorithm>
using namespace std;

    bool flag[20200];
    int k3,shu,e,du[20920],sz[2022],mid,ans,bian[1001*1001],tou[2020],hj[1001*1001],fangan[23020],n,k,i,x[2000],y[2000],j,dis[1001][1001],k1;
    long long right1,left1;

int delete1(int i)
{
    int sum=0,now=tou[i];
    while (now!=0)
    {
        if (sz[bian[now]]==2)
        {
            du[bian[now]]--;
            du[i]--;
            sum++;
        }
        now=hj[now];
    }
    return sum;
}

void bu(int i)
{
    int now=tou[i];
    while (now)
    {
        if (sz[bian[now]]==2)
        {
            du[bian[now]]++;
            du[i]++;
        }
        now=hj[now];
    }
}

bool dfs(int i,int k2,int shu)
{
    fangan[0]=k2;
    int k1=k2;
    if (i>n)
    {
        if (k2<=k3) return true;
        return false;
    }
    if (k2>k3) return false;
    if (shu==0) return true;
    int tmp,now;
    if (sz[i]==0||sz[i]==1) return dfs(i+1,k2,shu);
    if (du[i]==0) {sz[i]=1;if (dfs(i+1,k2,shu)) return true;sz[i]=2;return false;}
    {
        sz[i]=1;
        tmp=shu-delete1(i);
        now=tou[i];
        while (now!=0)
        {
            if (sz[bian[now]]==2)
            {
                k2++;
                fangan[k2]=bian[now];
                sz[fangan[k2]]=0;
                tmp-=delete1(fangan[k2]);
            }
            now=hj[now];
        }
        if (dfs(i+1,k2,tmp)) return true;
        for (tmp=k2;tmp>=k1+1;tmp--) {sz[fangan[tmp]]=2;bu(fangan[tmp]);}
        sz[i]=2;
        bu(i);
        k2=k1;
    }

        if (du[i]>1)
        {

          sz[i]=0;
          tmp=shu-delete1(i);
          fangan[k2+1]=i;
          if (dfs(i+1,k2+1,tmp)) return true;
          sz[i]=2;
          bu(i);
        }

    return false;
}

void cal(int mid)
{
     k=k1;
     for (i=1;i<=n;i++) sz[i]=2;
     e=0;shu=0;
     for (i=1;i<=n;i++)
     {
         du[i]=0;tou[i]=0;
     }
     for (i=1;i<=n;i++)
        for (j=1;j<=n;j++)
         {
          if (i==j) continue;
          if (dis[i][j]>mid)
          {
              e++;bian[e]=j;hj[e]=tou[i];tou[i]=e;du[i]++;shu++;
          }
         }
     fangan[0]=0;
     for (i=1;i<=n;i++) if (du[i]>k)
     {
         sz[i]=0;shu-=delete1(i);k--;
         fangan[0]++;fangan[fangan[0]]=i;
     }
     if (dfs(1,fangan[0],shu))
     {
         ans=(long long )mid;right1=((long long )mid-1);
     }else left1=mid+1;
}
int main()
{
 //   freopen("a.in","r",stdin);
 cin>>n>>k;
 k3=k;
 for (i=1;i<=n;i++) cin>>x[i]>>y[i];
 for (i=1;i<=n;i++)
    for (j=1;j<=n;j++)
 {
     if (i==j) continue;
     dis[i][j]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
 }
 k1=k;
 left1=0;right1=2147483647;
 while (left1<=right1)
 {
     mid=int((left1+right1)/2);
     cal(mid);
 }
 mid=ans;
 cal(2);
 cal(mid);
 //cout<<mid<<endl;
 for (i=1;i<=fangan[0];i++) {flag[fangan[i]]=true;cout<<fangan[i]<<" ";}
 mid=0;
 for (i=1;i<=n;i++) if (!flag[fangan[i]])
 {
     if (fangan[0]+mid==k3) return 0;
     cout<<i<<" ";
     mid++;

 }
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define mp make_pair
using namespace std;
const int maxn=1011;
struct pt{
    int x,y;
}   p[maxn];
int n,k,vt,tot,del,t[maxn],out[maxn],d[maxn],h[maxn];
int l[1000010],v[1000010],x[1000010],dis[maxn][maxn];
int sqr(int x){return x*x;}
int calc(pt a,pt b)
{
    return sqr(a.x-b.x)+sqr(a.y-b.y);
}
void res(int x)
{
    if(--t[x]!=0)return;
    --del;
    for(int i=h[x];i;i=l[i])if(!t[v[i]])
    {
        ++d[v[i]];++d[x];
    }
}
void rem(int x)
{
    if(++t[x]!=1)return;
    ++del;
    for(int i=h[x];i;i=l[i])if(!t[v[i]])
    {
        --d[v[i]];--d[x];
    }
}
bool dfs(int x)
{
    if(del>k)return 0;
    if(x>n)
    {
        out[0]=0;out[n+1]=n+1;
        for(int i=1;i<=n;++i)if(t[i])out[++out[0]]=i;
        else out[--out[n+1]]=i;
        return 1;
    }
    if(d[x]==0)return dfs(x+1);
    if(d[x]>1)
    {
        rem(x);
        if(dfs(x+1))return 1;
        res(x);
    }
    for(int i=h[x];i;i=l[i])rem(v[i]);
    if(dfs(x+1))return 1;
    for(int i=h[x];i;i=l[i])res(v[i]);
    return 0;
}
bool check(int len)
{
    del=vt=0;memset(h,0,sizeof(h));
    memset(d,0,sizeof(d));
    memset(t,0,sizeof(t));
    for(int i=1;i<=n;++i)
        for(int j=1;j<=n;++j)
            if(dis[i][j]>len)
            {
                v[++vt]=j;l[vt]=h[i];
                h[i]=vt;++d[i];
            }
    return dfs(1);
}
int main()
{
    //freopen("AC.in","r",stdin);
    //freopen("AC.out","w",stdout);
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;++i)scanf("%d%d",&p[i].x,&p[i].y);
    for(int i=1;i<=n;++i)for(int j=i;j<=n;++j)
    {
        dis[i][j]=dis[j][i]=calc(p[i],p[j]);
        x[++tot]=dis[i][j];
    }
    sort(x+1,x+tot+1);
    tot=unique(x+1,x+tot+1)-x-1;
    int l=1,r=tot,mid;
    while(l<r)
    {
        mid=(l+r)>>1;
        if(check(x[mid]))r=mid;
        else l=mid+1;
    }
    check(x[l]);
    for(int i=1;i<=k;++i)printf("%d ",out[i]);
    return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define mp make_pair
using namespace std;
const int maxn=1011;
struct pt{
    int x,y;
}   p[maxn];
int n,k,vt,tot,del,t[maxn],out[maxn],d[maxn],h[maxn];
int l[1000010],v[1000010],x[1000010],dis[maxn][maxn];
int sqr(int x){return x*x;}
int calc(pt a,pt b)
{
    return sqr(a.x-b.x)+sqr(a.y-b.y);
}
void res(int x)
{
    if(--t[x]!=0)return;
    --del;
    for(int i=h[x];i;i=l[i])if(!t[v[i]])
    {
        ++d[v[i]];++d[x];
    }
}
void del(int x)
{
    if(++t[x]!=1)return;
    ++del;
    for(int i=h[x];i;i=l[i])if(!t[v[i]])
    {
        --d[v[i]];--d[x];
    }
}
bool dfs(int x)
{
    if(del>k)return 0;
    if(x>n)
    {
        out[0]=0;out[n+1]=n+1;
        for(int i=1;i<=n;++i)if(t[i])out[++out[0]]=i;
        else out[--out[n+1]]=i;
        return 1;
    }
    if(d[x]==0)return dfs(x+1);
    if(d[x]>1)
    {
        del(x);
        if(dfs(x+1))return 1;
        res(x);
    }
    for(int i=h[x];i;i=l[i])del(v[i]);
    if(dfs(x+1))return 1;
    for(int i=h[x];i;i=l[i])res(v[i]);
    return 0;
}
bool check(int len)
{
    del=vt=0;memset(h,0,sizeof(h));
    memset(d,0,sizeof(d));
    memset(t,0,sizeof(t));
    for(int i=1;i<=n;++i)
        for(int j=1;j<=n;++j)
            if(dis[i][j]>len)
            {
                v[++vt]=j;l[vt]=h[i];
                h[i]=vt;++d[i];
            }
    return dfs(1);
}
int main()
{
    //freopen("AC.in","r",stdin);
    //freopen("AC.out","w",stdout);
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;++i)scanf("%d%d",&p[i].x,&p[i].y);
    for(int i=1;i<=n;++i)for(int j=i;j<=n;++j)
    {
        dis[i][j]=dis[j][i]=calc(p[i],p[j]);
        x[++tot]=dis[i][j];
    }
    sort(x+1,x+tot+1);
    tot=unique(x+1,x+tot+1)-x-1;
    int l=1,r=tot,mid;
    while(l<r)
    {
        mid=(l+r)>>1;
        if(check(x[mid]))r=mid;
        else l=mid+1;
    }
    check(x[l]);
    for(int i=1;i<=k;++i)printf("%d ",out[i]);
    return 0;
}


#include <cassert>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

struct edge {
  ll d;
  int a, b;
};

bool operator < (const edge &a, const edge &b) {
  return a.d > b.d;
}

#define maxn 1010
int n, k;

vector <int> res;
struct Graph {
  int vertex_n;
  vector <int> deg;

  struct node {
    int v;
    node *next, *prev;
    node() {
    }
    node (int v) :v(v){
    }
  };

  vector <node> by_deg_st, by_deg;
  node *edges;
  int edges_i;
  vector <node> edges_st;

  vector <int> log, marked;
  int marked_n;

  void connect (node *a, node *b) {
    a->next = b;
    b->prev = a;
  }
  void add_node (node *list, node *v) {
    connect (list->prev, v);
    connect (v, list);
  }

  void del_node (node *v) {
    connect (v->prev, v->next);
  }

  void fix_deg (int id) {
    node *v = &by_deg[id];
    del_node (v);
    add_node (&by_deg_st[deg[id]], v);
  }

  Graph(int n, int en)
   : vertex_n (n),
     deg (n, 0),
     by_deg_st (n),
     by_deg (n),
     edges(new node[en * 2]),
     edges_i(0),
     edges_st (n),
     marked (n, 0),
     marked_n (0) {
    for (int i = 0; i < n; i++) {
      by_deg_st[i].next = by_deg_st[i].prev = &by_deg_st[i];
      edges_st[i].next = edges_st[i].prev = &edges_st[i];
    }
    for (int i = 0; i < n; i++) {
      by_deg[i].v = i;
      add_node (&by_deg_st[0], &by_deg[i]);
    }
  }

  void log_del_edge (int x) {
    log.push_back(x + 1);
  }
  void log_del_vertex (int x) {
    log.push_back (-(x + 1));
  }
  void log_checkpoint (void) {
    log.push_back(0);
  }

  void add_edge (int fwd) {
    int rev = fwd ^ 1,
        b = edges[fwd].v,
        a = edges[rev].v;
    deg[a]++;
    deg[b]++;
    fix_deg (a);
    fix_deg (b);

    add_node (&edges_st[a], &edges[fwd]);
    add_node (&edges_st[b], &edges[rev]);
  }
  /*
  void del_edge (int id) {
    int a = edges[id].v, b = edge[id ^ 1].v;
    del_node (&edges[id]);
    del_node (&edges[id ^ 1]);
    deg[a]--;
    deg[b]--;
    fix_deg (a);
    fix_deg (b);
  }*/

  void new_edge (int a, int b) {
    int fwd = edges_i;

    edges[edges_i++].v = b;
    edges[edges_i++].v = a;

    add_edge (fwd);
  }

  void del_vertex (int v) {
    node *end = &edges_st[v];
    for (node *end = &edges_st[v], *i = end->next; i != end; i = i->next) {
      int id = i - edges;

      log_del_edge (id);
      del_node (i);

      del_node (&edges[id ^ 1]);
      deg[i->v]--;
      deg[v]--;
      fix_deg (i->v);
    }

    log_del_vertex (v);
    vertex_n--;
    del_node (&by_deg[v]);
  }

  void log_restore (void) {
    int x;
    while ((x = log.back()) != 0) {
      log.pop_back();
      if (x < 0) {
        x = -x - 1;
        add_node (&by_deg_st[0], &by_deg[x]);
        vertex_n++;
        if (marked[x]) {
          marked[x] = 0;
          marked_n--;
        }
      } else {
        x = x - 1;
        add_edge (x);
      }
    }
    log.pop_back();
  }

  void del_01 () {
    while (true) {
      node *i = &by_deg_st[1];
      if (i->next == i) {
        break;
      }

      int v = i->next->v, u = edges_st[v].next->v;
      marked[u] = 1;
      marked_n++;

      del_vertex (u);
    }

    for (node *end = &by_deg_st[0], *i = end->next; i != end; i = i->next) {
      del_vertex (i->v);
    }
  }

  void dump_result() {
    res.clear();
    for (int i = 0; i < n; i++) {
      if (marked[i]) {
        res.push_back(i);
      }
    }
  }

  bool solve (int max_deg, int k) {
    del_01();

    if (k < marked_n) {
      return false;
    }

    if (vertex_n == 0) {
      dump_result();
      return true;
    }

    while (by_deg_st[max_deg].next == &by_deg_st[max_deg]) {
      max_deg--;
    }

    if ((max_deg + 1) * (k - marked_n) < vertex_n) {
      return false;
    }

    int v = by_deg_st[max_deg].next->v;

    log_checkpoint();
    marked[v] = 1;
    marked_n++;
    del_vertex (v);
    if (solve (max_deg, k)) {
      return true;
    }
    log_restore();
    if (k - marked_n > max_deg && max_deg > 2) {
      log_checkpoint();
      for (node *end = &edges_st[v], *i = end->next; i != end; i = i->next) {
        int u = i->v;
        marked[u] = 1;
        marked_n++;
        del_vertex (u);
      }
      if (solve (max_deg, k)) {
        return true;
      }
      log_restore();
    }

    return false;
  }
  ~Graph() {
    delete[] edges;
  }
};

bool can (const vector <edge> &edges, int edges_n, int k) {
  Graph g(n, edges_n);
  for (int i = 0; i < edges_n; i++) {
    g.new_edge (edges[i].a, edges[i].b);
  }
  return g.solve (n - 1, k);
}

int main (void) {
  scanf ("%d%d", &n, &k);
  vector <int> xs (n), ys (n);

  for (int i = 0; i < n; i++) {
    scanf ("%d%d", &xs[i], &ys[i]);
  }

  int edges_n = n * (n - 1) / 2, edges_i = 0;
  vector <edge> edges(edges_n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      edges[edges_i].d = (ll)(xs[i] - xs[j]) * (xs[i] - xs[j]) + (ll) (ys[i] - ys[j]) * (ys[i] - ys[j]);
      edges[edges_i].a = i;
      edges[edges_i++].b = j;
    }
  }

  sort (edges.begin(), edges.end());

  int l = 0, r = edges_n + 1;
  while (l + 1 < r) {
    int c = (l + r) / 2;
    if (can (edges, c, k)) {
      l = c;
    } else {
      r = c;
    }
  }

  can (edges, l, k);
  vector <int> mask(n, 0);
  for (int i = 0; i < (int)res.size(); i++) {
    mask[res[i]] = 1;
  }
  int left = k - (int)res.size();
  for (int i = 0; i < n && left > 0; i++) {
    if (!mask[i]) {
      mask[i] = 1;
      left--;
    }
  }
  for (int i = 0; i < n; i++) {
    if (mask[i]) {
      printf ("%d ", i + 1);
    }
  }

  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <climits>
#include <numeric>
#include <vector>
#include<time.h>
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
#define REP(i,n) for(int i=0;i<n;++i)
using namespace std;
const int MAX_N = 1005;
const int MAX_K = 31;
struct Pair {
	int a, b, dist;
	bool operator<(const Pair&o) const {
		return dist < o.dist;
	}
};
int x[MAX_N], y[MAX_N], n, k;
int dist[MAX_N][MAX_N];
Pair ps[MAX_N * MAX_N];
int nPs;
bool used[MAX_N];
const double EPS = 1e-8;
inline int sign(double a) {
	return a < -EPS ? -1 : a > EPS;
}
typedef long long int64;
struct Point {
	int64 x, y;
	Point() {
	}
};
Point pt[MAX_N];
#define cross(p1,p2,p3) ((p2.x-p1.x)*(p3.y-p1.y)-(p3.x-p1.x)*(p2.y-p1.y))
int leftId[MAX_N], rightId[MAX_N];
vector<int> edge[MAX_N];
int pR[MAX_N];
int mark[MAX_N], cur = 0;
bool dfs(int u) {
	if (mark[u] == cur)
		return false;
	mark[u] = cur;
	for (vector<int>::iterator e = edge[u].begin(); e != edge[u].end(); ++e) {
		if (pR[*e] == -1 || dfs(pR[*e]))
			return pR[*e] = u, true;
	}
	return false;
}
bool check(int who) {
	//make all <=i
	int a = ps[who].a, b = ps[who].b, d = ps[who].dist;
	int bad = 0;
	int nL = 0, nR = 0;
	memset(leftId, -1, sizeof leftId);
	memset(rightId, -1, sizeof rightId);
	for (int i = 0; i < n; ++i)
		if (i != a && i != b) {
			if (dist[a][i] <= d && dist[b][i] <= d) {
				if (cross(pt[a],pt[b],pt[i]) > 0) //left
					leftId[i] = nL++;
				else
					rightId[i] = nR++;
			} else {
				++bad;
			}
		}
	if (bad > k)
		return false;
	//return 0;
	memset(pR, -1, sizeof pR);
	for (int i = 0; i < nL; ++i) {
		edge[i].clear();
	}
	for (int i = who + 1; i < nPs; ++i) {
		if (ps[i].dist > d) {
			int a = ps[i].a, b = ps[i].b;
			if (leftId[a] == -1)
				swap(a, b);
			if (leftId[a] == -1)
				continue;
			if (rightId[b] == -1)
				continue;
			edge[leftId[a]].push_back(rightId[b]);
		}
	}
	int cnt = 0;
	for (int i = 0; i < nL; ++i) {
		++cur;
		if (dfs(i))
			++cnt;
		if (cnt > k - bad) {
			return false;
		}
	}
	return true;
}
const int INF = INT_MAX / 4;
template<class Flow>
struct Maxflow {
	struct Edge {
		int t;
		Flow c;
		Edge*n, *r;
		Edge(int _t, Flow _c, Edge*_n) :
				t(_t), c(_c), n(_n) {
		}
	};
	vector<Edge*> E;
	int addV() {
		E.push_back((Edge*) 0);
		return E.size() - 1;
	}
	void clear() {
		E.clear();
	}
	Edge* makeEdge(int s, int t, Flow c) {
		return E[s] = new Edge(t, c, E[s]);
	}
	Edge* addEdge(int s, int t, Flow c) {
		Edge*e1 = makeEdge(s, t, c), *e2 = makeEdge(t, s, 0);
		e1->r = e2, e2->r = e1;
		return e1;
	}
	int calcMaxFlow(int vs, int vt) {
		int nV = E.size();
		Flow totalFlow = 0;
		Flow MAX_FLOW = INF;
		vector<Flow> am(nV, 0);
		vector<int> h(nV, 0), cnt(nV + 1, 0);
		vector<Edge*> prev(nV, (Edge*) 0), cur(nV, (Edge*) 0);
		cnt[0] = nV;
		int u = vs;
		Edge*e;
		am[u] = MAX_FLOW;
		while (h[vs] < nV) {
			for (e = cur[u]; e; e = e->n)
				if (e->c > 0 && h[u] == h[e->t] + 1)
					break;
			if (e) {
				int v = e->t;
				cur[u] = prev[v] = e;
				am[v] = min(am[u], e->c);
				u = v;
				if (u == vt) {
					Flow by = am[u];
					while (u != vs) {
						prev[u]->c -= by;
						prev[u]->r->c += by;
						u = prev[u]->r->t;
					}
					totalFlow += by;
					am[u] = MAX_FLOW;
				}
			} else {
				if (!--cnt[h[u]])
					break;
				h[u] = nV;
				for (e = E[u]; e; e = e->n)
					if (e->c > 0 && h[e->t] + 1 < h[u]) {
						h[u] = h[e->t] + 1;
						cur[u] = e;
					}
				++cnt[h[u]];
				if (u != vs)
					u = prev[u]->r->t;
			}
		}
		return totalFlow;
	}
	vector<bool> reach;
	void dfs(int u) {
		if (reach[u])
			return;
		reach[u] = true;
		for (Edge* e = E[u]; e; e = e->n)
			if (e->c > 0)
				dfs(e->t);
	}
	void genCut(int src) {
		reach = vector<bool>(E.size());
		dfs(src);
	}
	~Maxflow() {
		for (int i = 0; i < E.size(); ++i) {
			for (Edge*e = E[i]; e;) {
				Edge*ne = e->n;
				delete e;
				e = ne;
			}
		}
	}
	bool isCut(int s, Edge*e) {
		return reach[s] && !reach[e->t];
	}
};
Maxflow<int> sap;
Maxflow<int>::Edge*LE[MAX_N], *RE[MAX_N];
int ls[MAX_N], rs[MAX_N];
bool deled[MAX_N];
void build(int who) {
	//make all <=i
	int a = ps[who].a, b = ps[who].b, d = ps[who].dist;
	int cnt = 0;
	int nL = 0, nR = 0;
	memset(leftId, -1, sizeof leftId);
	memset(rightId, -1, sizeof rightId);
	memset(deled, false, sizeof deled);
	int del[MAX_N];
	for (int i = 0; i < n; ++i)
		if (i != a && i != b) {
			if (dist[i][a] <= d && dist[i][b] <= d) {
				if (cross(pt[a],pt[b],pt[i]) > 0) {
					leftId[i] = nL;
					ls[nL++] = i;
				} else {
					rightId[i] = nR;
					rs[nR++] = i;
				}
			} else {
				del[cnt++] = i;
				deled[i] = true;
			}
		}
	memset(pR, -1, sizeof pR);
	for (int i = 0; i < nL; ++i) {
		edge[i].clear();
	}
	sap.clear();
	for (int i = 0; i < nL; ++i) {
		sap.addV();
	}
	for (int i = 0; i < nR; ++i) {
		sap.addV();
	}
	int S = sap.addV(), T = sap.addV();
	for (int i = 0; i < nL; ++i) {
		LE[i] = sap.addEdge(S, i, 1);
	}
	for (int i = 0; i < nR; ++i) {
		RE[i] = sap.addEdge(i + nL, T, 1);
	}
	for (int i = who + 1; i < nPs; ++i) {
		if (ps[i].dist > d) {
			int a = ps[i].a, b = ps[i].b;
			if (leftId[a] == -1)
				swap(a, b);
			if (leftId[a] == -1)
				continue;
			if (rightId[b] == -1)
				continue;
			int l = leftId[a], r = rightId[b];
			sap.addEdge(l, r + nL, INT_MAX);
		}
	}
	sap.calcMaxFlow(S, T);
	sap.genCut(S);
	for (int i = 0; i < nL; ++i) {
		if (sap.isCut(S, LE[i])) {
			deled[ls[i]] = true;
			del[cnt++] = ls[i];
		}
	}
	for (int i = 0; i < nR; ++i) {
		if (sap.isCut(i + nL, RE[i])) {
			deled[rs[i]] = true;
			del[cnt++] = rs[i];
		}
	}
	for (int i = 0; i < n; ++i) {
		if (!deled[i] && cnt < k) {
			deled[i] = true;
			del[cnt++] = i;
		}
	}
	for (int i = 0; i < cnt; ++i) {
		printf("%d ", del[i] + 1);
	}
	puts("");
}
int main() {
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
	cin >> n >> k;
	int t1=clock();
	for (int i = 0; i < n; ++i) {
		scanf("%d%d", x + i, y + i);
		pt[i].x = x[i];
		pt[i].y = y[i];
	}
	if (n - k == 1) {
		for (int i = 1; i < n; ++i) {
			cout << i << " ";
		}
		cout << endl;
		return 0;
	}
	nPs = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			int dx = x[i] - x[j], dy = y[i] - y[j];
			dist[i][j] = dx * dx + dy * dy;
		}
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < i; ++j) {
			ps[nPs++] = (Pair) {i,j,dist[i][j]};
		}
	}
	sort(ps, ps + nPs);
	//printf("sort time=%d\n",clock()-t1);
	int st = nPs;
	for (int i = 0; i < k; ++i) {
		st -= n - 1 - i;
	}
	--st;
	if (st < 0)
		st = 0;
	for (int i = st; i < nPs; i++) {
		if (check(i)) {
			build(i);
			//printf("ans=%d id=%d\n",ps[i].dist,i-st+1);
			//printf("time=%d\n",clock()-t1);
			//system("pause");for (;;);
			return 0;
		}
	}
	//printf("error! time=%d\n",clock()-t1);
	//system("pause");for (;;);
	return 0;
}