uses crt;
var a:array[1..100]of integer;
i,n,t,j,tam:integer;
begin
clrscr;
readln(n,k);
for i:=1 to n do readln(a[i]);
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;
write(a[k]);
readln;
end.
program sonho;
var
arr:array[1..100] of integer;
k, n, i, min: integer;
begin
write('Nhap n: ');
readln(n);
write('Nhap cac phan tu cua day: ');
for i := 1 to n do
begin
readln(arr[i]);
end;
write('Nhap k: ');
readln(k);
min := arr[1];
for i := 2 to k do
begin
if (arr[i] < min) then
min := arr[i];
end;
writeln('So nho thu ', k, ' trong day la: ', min);
end.