var
a:array[1..N] of integer;
i,x:integer;
begin
for i:=1 to N do
readln(a[i]);
if (a[i]>=49) and ((a[i] mod 7)=0)
then x += a[i];
end;
then a[i]:=x;
writeln(a[i]);
end.
var
a:array[1..N] of integer;
i,x:integer;
begin
for i:=1 to N do
begin
readln(a[i]);
if (a[i]>=49) and ((a[i] mod 7)=0)
then x += a[i];
end;
for i:=1 to N do
begin
if (a[i]>=49) and ((a[i] mod 7)=0)
then a[i]:=x;
writeln(a[i]);
end;
end.