n=int(input()) a=input().split() x=int(input()) for i in range(x-1,n-1): a[i]=a[i+1] for i in range(n-1): print(a[i],end=" ")