#include using namespace std; #define int long long const int p=1e9+7; const int base=1837277; const int maxn=2e5+5; int po[maxn]; int ha[maxn];vector a; int get(int i,int j) { return ((ha[j]-po[j-i]*ha[i])%p+p)%p; } bool cmp1(int i,int j) { if(get(i,j)==get(i+1,j+1)) { return true; } int low=i;int up=j; while(up-low>1) { int mid=(low+up)/2; if(get(i,mid)==get(i+1,mid+1)) low=mid; else up=mid; } return a[low]>a[low+1]; } bool cmp(int i,int j) { if(i==j) return false; if(i>j) return !cmp1(j,i); if(get(i,j)==get(i+1,j+1)) { return false; } int low=i;int up=j; while(up-low>1) { int mid=(low+up)/2; if(get(i,mid)==get(i+1,mid+1)) low=mid; else up=mid; } return a[low]>a[low+1]; } int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); po[0]=1;for(int i=1;i>n>>k;a.resize(n); for(int i=0;i>a[i];ha[i+1]=(ha[i]*base+a[i])%p;} vector v(n);iota(v.begin(),v.end(),0); sort(v.begin(),v.end(),cmp); a.erase(a.begin()+v[k-1]); for(int x:a) cout<