var a:array[1..200] of integer;
n,i,s:integer;
begin
write('Nhap so luong phan tu n = ');readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,' = ');readln(a[i]);
end;
writeln('Day so vua nhap la: ');
for i:=1 to n do write(a[i]:5);
writeln('Cac phan tu chia het cho 3 la:');
for i:=1 to n do
begin
if a[i] mod 3 = 0 then
begin
write(a[i]:5);
s:=s+a[i];
end;
end;
writeln('Tong cac phan tu chia het cho 3 la ',s);
writeln('Cac phan tu la so am: ');
for i:=1 to n do
if a[i]<0 then write(a[i]:5);
readln;
end.