#include int main() { int i, N, K, A[200001]; scanf("%d %d", &N, &K); for (i = 1; i <= N; i++) scanf("%d", &(A[i])); int j, q[200001], head = 1, tail = N; for (i = 1; i <= N; ) { for (j = i; j < N; j++) if (A[j] != A[j+1]) break; if (A[i] > A[j+1] || j == N) { for (; i <= j; i++) q[head++] = i; } else { for (; i <= j; i++) q[tail--] = i; } } for (i = 1; i <= N; i++) { if (i != q[K]) printf("%d ", A[i]); } printf("\n"); fflush(stdout); return 0; }