[cpp]
#include
#include
#include
using namespace std;
priority_queue < int > Q;
int main() www.2cto.com
{
int money,m,n;
while(~scanf("%d %d",&n,&m)&&n)
{
m=m
while(Q.empty()==false)Q.pop();
while(n--){scanf("%d",&money);Q.push(money);}
if(m){money=Q.top();Q.pop();printf("%d",money);}
while(--m){money=Q.top();Q.pop();printf(" %d",money);}
printf("\n");
}
return 0;
}