#include <stdio.h>
#define N 10
int main(void)
{
int i, a[N], sum=0;
for (i=0; i<N; i++)
{
scanf("%d", &a[i]);
sum += a[i];
}
for (i=0; i<N; i++)
{
printf("%d ", a[i]);
if (i%3 == 2)
printf("\n");
}
printf("\nsum=%d\n", sum);
}