#include #include #include using namespace std; int main(){ int n, k; cin >> n >> k; vector a(n); for(auto &it: a) cin >> it; vector v(n); for(int i = 0; i < n; i++) v[i] = i; sort(v.begin(), v.end(), [&](int x, int y){ if(x < y){ y = x; x = x+1; }else{ x = y; y = y+1; } for(; max(x, y) < n; x++, y++){ if(a[x] != a[y]) return a[x] < a[y]; } }); vector ans; for(int i = 0; i < n; i++){ if(v[k-1] == i) continue; ans.emplace_back(a[i]); } for(int i = 0; i < ans.size(); i++) cout << ans[i] << " \n"[i == ans.size()-1]; return 0; }