// file creato da gio il 2020-06-24 19:30:16.614643

#include <bits/stdc++.h>
#define FAST 

#ifdef FAST
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

#define MOD 1000000007
#define S second
#define F first
#define PB push_back
using namespace std;

int main(){
	//freopen("output","w",stdout);
	//freopen("input","r",stdin);
#ifdef FAST
	ios::sync_with_stdio(0);
  	cin.tie(0);
#endif

	int n,k;
	cin >> n>>k;
    int ar[n];
    for(int i=0;i<n;i++){
        cin >> arr[i];
    }
    sort(ar,ar+n);
    for(int i=0;i<k;--i)cout <<ar[i]<<" ";
    


}
