using System;
using System.Collections.Generic;

namespace TakProg1
{
    class Program
    {
        static void Main(string[] args)
        {
            List <int> ListaIntova = new List <int> ();
            int N, K;
            int brojac = 0;
            int[] niz;
            string c = Console.ReadLine();
            string[] a = c.Split();
            N = int.Parse(a[0]);
            K = int.Parse(a[1]);
            niz = new int[N];
            string b = Console.ReadLine();
            string [] g = b.Split();
            for (int i = 0; i < g.Length; i++)
            {
                niz[i] = int.Parse(g[i]);
            }
            
            for (int i = 0; i < niz.Length; i++)
            {
                
                brojac = 0;
                for (int j = 0; j < niz.Length; j++)
                {
                    if (niz[i] == niz[j]) brojac++;
                }
                if (brojac >= K)
                {
                    if(!ListaIntova.Contains(niz[i]))
                    {
                        ListaIntova.Add(niz[i]);

                    }
                             
                    
                }
            }
            for (int i = 0; i < ListaIntova.Count; i++)
            {
                Console.Write(ListaIntova[i]+" ");
                
            }



        }
    }
}