uses crt;
var a:array[1..1000] of integer;
i,max,n:integer;
begin
clrscr;
write('n<1000, n=');<br>read(n);
writeln('a[i]<30000, a[i]:');<br>for i:=1 to n do
begin
readln(a[i]);
if (a[i] mod 10=3) and (a[i]>max) then max:=a[i];
end;
write('max=',max);
end.