Var
i, v, n, vm: longint;
ar: array of integer;
begin
vm := 0;
readln(n);
setlength(ar, n);
for i := 1 to n do
begin
read(v);
ar[i - 1] := v * 30;
vm := vm + v;
end;
writeln;
for i := 1 to n do
write(ar[i - 1], ' ');
writeln;
write('Общий вес: ', vm);
end.