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