#d1404. 字典序最小

字典序最小

Lexicographically Smallest

Problem Description

Choose NN distinct numbers in order from a sequence of MM numbers, so that the NN numbers form the lexicographically smallest sequence.

Input Format

The first line contains two integers M,NM, N — the length of the sequence and the number of numbers to choose in order (1<N≤M≤1061 < N \le M \le 10^6).

The next MM lines: the ii-th line contains aia_i, the ii-th number of sequence MM, where 1≤ai≤N1 \le a_i \le N. It is guaranteed that every number in [1,N][1, N] appears at least once.

Output Format

Output NN numbers separated by spaces, representing the lexicographically smallest sequence (no trailing space after the last number).

Sample Input

6 3
3
2
1
3
1
3

Sample Output

2 1 3

Hint

The lexicographically smallest sequence you are looking for need not be contiguous in sequence MM.