#include<stdio.h>

int main() {
    int n,i,r, found =0;
    scanf("%d", &n);
    
    int a[n];
    for(i = 0;i < n; i++)
    scanf("%d",&a[i]);
    
    scanf("%d", &r);
    
    for(i=0; i<n; i++) {
        if([i] == r)
        found = 1;
        if (found && i < n-1)
        a[i] = a[i+1];
    }
    printf("Route not found");
    else
    for(i = 0; i < n-1; i++)
    printf("%d ",a[i]);
    
    return 0;
}