#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
//#define int long long
using namespace __gnu_pbds;
using namespace std;
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
int n,k,l[100010],r[100010],nxt[200010][20];
vector<int> v[200010];
set<pair<int,int> > s;
inline int calc(int x,int y)
{
int tot=0;
for(int i=20-1;i>=0;i--) if(nxt[x][i]<=y){
x=nxt[x][i];tot+=(1<<i);
}
return tot;
}
signed main()
{
ios::sync_with_stdio(false);cin.tie(0);
cin>>n>>k;
for(int i=1;i<=n;i++) cin>>l[i]>>r[i];
vector<int> vec;
for(int i=1;i<=n;i++) vec.push_back(l[i]),vec.push_back(r[i]);
sort(vec.begin(),vec.end());vec.erase(unique(vec.begin(),vec.end()),vec.end());
int cnt=(int)vec.size();
for(int i=1;i<=n;i++){
l[i]=lower_bound(vec.begin(),vec.end(),l[i])-vec.begin()+1;
r[i]=lower_bound(vec.begin(),vec.end(),r[i])-vec.begin()+1;
v[l[i]].push_back(r[i]);
}
int minv=cnt+1;
for(int i=cnt+1;i>=0;i--){
for(int j=0;j<(int)v[i].size();j++) minv=min(minv,v[i][j]);
nxt[i][0]=minv;
}
for(int i=1;i<20;i++){
for(int j=0;j<=cnt+1;j++){
nxt[j][i]=nxt[nxt[j][i-1]][i-1];
}
}
int now=0,res=calc(0,cnt);
if(res<k){
cout<<-1<<'\n';
return 0;
}
vector<int> ans;
s.insert(make_pair(0,0));s.insert(make_pair(cnt,cnt));
set<pair<int,int> >::iterator it;
for(int i=1;i<=n&&now<k;i++){
pair<int,int> x=make_pair(l[i],r[i]);
it=s.lower_bound(x);
pair<int,int> nxt=(*it);it--;
pair<int,int> pre=(*it);
if(!(pre.second<=x.first&&x.second<=nxt.first)) continue;
int nw=now+1+res;
nw-=calc(pre.second,nxt.first);
nw+=calc(pre.second,x.first);nw+=calc(x.second,nxt.first);
if(nw<k) continue;
now++;res=nw-now;ans.push_back(i);
s.insert(x);
}
for(int i=0;i<(int)ans.size();i++){
cout<<ans[i]<<'\n';
}
return 0;
}