uses crt;
var a,vt:array[1..250]of integer;
i,n,max,dem:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until (0<n) and (n<=250);
for i:=1 to n do
begin
repeat
write('A[',i,']='); readln(a[i]);
until a[i]<=500;
end;
max:=a[1];
dem:=0;
for i:=1 to n do
if max<a[i] then max:=a[i];
for i:=1 to n do
if max=a[i] then
begin
inc(dem);
vt[dem]:=i;
end;
writeln('Gia tri lon nhat la: ',max);
write('Vi tri: ');
for i:=1 to dem do
write(vt[i]:4);
readln;
end.