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