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

namespace Pikado
{
    class Program
    {
        static void Main(string[] args)
        {
            var ulaz1 = Console.ReadLine().Split();
            int n = int.Parse(ulaz1[0]);
            int k = int.Parse(ulaz1[1]);
            int[] a = new int[n];
            int i;
            var ulazniz = Console.ReadLine().Split();
            for(i = 0; i < n; i++)
            {
                a[i] = int.Parse(ulazniz[i]);
            }
            int j;
            for(i = 0; i < n; i++)
            {
                int br = 1;
                for(j = i + 1; j < n; j++)
                {
                    if(a[i] == a[j])
                    {
                        br++;
                    }
                    if(br >= k)
                    {
                        Console.Write(a[i]);
                    }
                }
            }          
        }
    }
}