var f,g:text;
A:array[1..1000] of integer;
n,i:integer;
procedure kt_ndl;
begin
Assign(f,'daycongiam.inp');
Assign(g,'daycongiam.out'); rewrite(g);
{$I-} reset(f); {$I+}
if IOresult<>0 then
begin
rewrite(f);
reset(f);
end;
readln(f,n);
for i:=1 to n do read(f,A[i]);
end;
procedure xl;
var j,d,max,vt1,vt2:integer;
begin
max:=1; vt1:=1; vt2:=1;
for i:=1 to n-1 do
begin
d:=1; j:=i;
while A[j]>=A[j+1] do
begin
inc(j);
inc(d);
end;
if d>max then
begin
max:=d;
vt1:=i;
vt2:=j;
end;
end;
if max=1 then write(g,'Khong co day giam dan')
else
begin
writeln(g,max);
for i:=vt1 to vt2 do
write(g,A[i],' ');
end;
end;
BEGIN
kt_ndl; xl;
close(f); close(g);
end.