//PascalABC.NET
1)
var
num, sum: integer;
begin
sum := 0;
repeat
read(num);
if (num mod 4 = 0) and (num div 1000 = 0) and (num div 100 <> 0) then
sum := sum + num;
until (num = 0);
write(sum);
end.
2)
num, max, n, i: integer;
max := 0;
read(n);
for i := 1 to n do
if (num mod 10 = 3) and (num > max) then
max := num;
end;
write(max);
//PascalABC.NET
1)
var
num, sum: integer;
begin
sum := 0;
repeat
read(num);
if (num mod 4 = 0) and (num div 1000 = 0) and (num div 100 <> 0) then
sum := sum + num;
until (num = 0);
write(sum);
end.
2)
var
num, max, n, i: integer;
begin
max := 0;
read(n);
for i := 1 to n do
begin
read(num);
if (num mod 10 = 3) and (num > max) then
max := num;
end;
write(max);
end.