#include <iostream>
using namespace std;
int main()
{
	int n,k;
    cin >>n;
    int a[n],brojevi[2*n+1];
    for (int i=0;i<=2*n;i++)
    {
    	brojevi[i]=0;
    }
    cin>>k;
    for (int i=0;i<n;i++)
    {
    	cin >>a[i];
        brojevi[a[i]+n]++;
    }
    for (int i=0;i<=2*n;i++)
    {
    	if(brojevi[i]>=k)
    	{
    		cout <<i-n<<" ";
    	}
    }
    return 0;
}