#include <bits/stdc++.h>

#define inti long long
#define ioigold ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define nl '\n'
#define sz(s) (int)s.size()
#define pb push_back   
#define con continue
#define S second
#define F first

using namespace std;

const int N = (int)3e5 + 7;
const int inF = (int)-1e9 - 7;
const int INF = (int)1e18 + 7;                                                  
const int mod = 1e9 + 7;

int a[444];

void solve(){
	int n;
	cin >> n;

	for(int i = 1; i <= n; ++i){
		cin >> a[i];
	}
	
	int l, r;
	cin >> l >> r;

	sort(a + l, a + r + 1);

	for(int i = 1; i <= n; ++i){
		cout << a[i] << ' ';
	}
}

int main() {
	//freopen("complete.in", "r", stdin);
    //freopen("complete.out", "w", stdout);
	                                                                               
	ioigold                                             
	
    int T = 1;
    //cin >> T;

    while(T--){
    	solve();
    }
}