#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	int niz[1000000];
	for (int i = 0; i < n; i++)
		cin >> niz[i];

	int dup[1000000];
	for (int i = 0; i < 1000; i++)
		dup[i] = 0;

	int min = niz[0];
	for (int i = 0; i < n; i++)
		if (niz[i] < min)
			min = niz[i];

	if (min < 0)
	{
		for (int i = 0; i < n; i++)
			dup[niz[i] - min]++;
		for (int i = 0; i < n; i++)
			if(dup[niz[i] - min] >= k)
			{
				cout << niz[i] << " ";
				dup[niz[i] - min] = 0;
			}
	}
	else
	{
		for (int i = 0; i < n; i++)
			dup[niz[i]]++;
		for (int i = 0; i < n; i++)
			if (dup[niz[i]] >= k)
			{
				cout << niz[i] << " ";
				dup[niz[i]] = 0;
			}
				
	}
	
	return 0;
}