#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, a[100005] = {}, k;
cin >> n;
for (int i = 1; i <= n; i++)
scanf("%d", a + i);
cin >> k;
sort(a + 1, a + n + 1);
for (int i = n; k--; i--)
printf("%d\n", a[i]);
return 0;
}