import sys input = sys.stdin.readline N,K=map(int,input().split()) A=list(map(int,input().split())) k=0 for i in range(N-1): if A[i]>=A[i+1]: k+=1 if k==K: ans=A[:i]+A[i+1:] print(*ans) exit() k=0 K=N-K+1 for i in range(N-1): if A[i]