uses crt;
var a:array[1..100]of integer;
i,n,t,t1,j,tam:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
t:=0;
for i:=1 to n do t:=t+a[i];
t1:=0;
for i:=1 to n do
if a[i] mod 2=0 then t1:=t1+a[i];
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]<a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln(t);
writeln(t1);
for i:=1 to n do write(a[i]:4);
readln;
end.