import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        int niz[] = new int[n];

        for (int i = 0; i <n; i++) {
        niz[i] = sc.nextInt();
        }

        Arrays.sort(niz);

        for (int i = 0; i < n-k+1; i++) {
            if (niz[i] == niz[i+k-1])
            {
                System.out.println(niz[i]);
                //i += k;
            }
        }
    }
}