program oken;
var f: text;
n,i,j,tam,k: longint;
a:array[1..10000] of longint;
begin
assign(f,'nhap.inp'); reset(f);
write(f,'A: '); n:=0;
repeat
inc(n);
read(f,a[i]);
until eof(f);
readln(f); readln(f,k);
close(f);
assign(f,'xuat.out'); rewrite(f);
for i:=1 to n-1 do
for j:= i+1 to n do
if a[i]<a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
for i:=1 to k do
write(f,a[i]);
close(f);
end.