using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
    class Program 
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int k = int.Parse(s[1]);
            int[] pikado = new int[2 * n + 1];
            int[] pogodci = new int[n];
            string[] p = Console.ReadLine().Split(' ');
            for(int i=0;i<n;i++)
            {
                pogodci[i] = Convert.ToInt32(p[i]);
            }
            for(int i=-n;i<=n;i++)            
                for(int j=0;j<n;j++)
                {
                    if (pogodci[j] == i) pikado[i + n]++;
                }
            string u = "";
            for (int i = 0; i < 2 * n + 1; i++)
            {
                if (pikado[i] >= k) u += (i - n).ToString() + " ";
            }        
            Console.WriteLine(u);    
        }
    }
}