#include <stdio.h>

int main(){
    int n;
    
    scanf("%d", &n);
    
    int queue[20];
    for(int i=0; i<n; i++){
        scanf("%d", queue[i]);
    }
    
    int pos, value;
    scanf("%d %d", &pos, &value);
    
    for (int i=n; i>pos; i--){
        queue[i]=queue[i-1];
    }
    
    queue[pos]= value;
    for(int i=0; i<= n; i++){
        printf("%d", queue[i]);
    }
    return 0;
}