#include <bits/stdc++.h>
using namespace std;
long long a[1000],b[1000],i,n,t,dem;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
dem=0;
for (i=1; i<=n; i++)
if (a[i]%2!=0)
{
dem++;
b[dem]=a[i];
}
for (i=1; i<=dem; i++) cout<<b[i]<<" ";
cout<<endl;
t=0;
for (i=1; i<=dem; i++) t+=b[i];
cout<<t;
return 0;
}