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