Program hotrotinhoc;
var k,n,i,x: integer;
a: array[1..32000] of integer;
begin
write('n='); readln(n);
write('k='); readln(k);
for i:=1 to n do
begin
write('a[',i,']='); readln(x);
inc(a[x]);
end;
for i:=1 to 32000 do
if a[i]=k then write(i,' ');
readln
end.