var
a : array of integer := new integer[10];
s : integer;
begin
for var i := 0 to a.Length-1 do read(a[i]);
foreach b : integer in a do begin
write(b, ' ');
if abs(b mod 10) = 6 then s += b;
end;
writeln(#13, s);
end.
var
a : array of integer := new integer[10];
s : integer;
begin
for var i := 0 to a.Length-1 do read(a[i]);
foreach b : integer in a do begin
write(b, ' ');
if abs(b mod 10) = 6 then s += b;
end;
writeln(#13, s);
end.