/* * c.cpp * * Created on: 2013-10-7 * Author: wangzhu */#include#include #include #include #include #include using namespace std;int main() { freopen("data.in", "r", stdin); int n,m,k; while(~scanf("%d%d",&n,&m)) { if(0 == n && 0 == m) { break; } priority_queue ,less > p; for(int i = 0;i < n;i++) { scanf("%d", &k); p.push(k); } if(m > n) { m = n; } m --; printf("%d",p.top()); p.pop(); while(m--) { printf(" %d",p.top()); p.pop(); } printf("\n"); } return 0;}