#include
using namespace std;
int N;
void BubbleSort(int A[], int s, int m)
{
int cun;
for(int i=m;i>0;i--)
for (int j = 0; j < m-1; j++)
{
if (A[s + j ] < A[s + j + 1])
{
cun = A[s + j ];
A[s + j ] = A[s + j + 1];
A[s + j + 1] = cun;
}
}
}
int main()
{
int s, m, * p;
cin >> N;
p = new int[N];
for (int k = 0; k < N; k++)
cin >> *(p + k);
cin >> s >> m;
BubbleSort(p,s,m);
for (int k = 0; k < N; k++)
cout << *(p + k)<<" ";
delete[]p;
p = 0;
return 0;
}