#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int p[N], q[N];
int main() {
int n, k;
cin >> n >> k;
for(int i = 1; i <= n; i++) cin >> p[i];
sort(p + 1, p + n + 1);
int psr = 0;
for(int i = 1, j = 1; i <= n; i++) {
if(p[i] > 0) {
if(i - j + 1 == k) {
q[psr++] = p[j];
j++;
}
}
}
for(int i = 1; i <= psr; i++) {
cout << q[i] << endl;
}
return 0;
}