#include <stdio.h>

int main()
{
    double score[5][5] = { 0 };
    //输入
    for (int i = 0; i < 5; i++)
    {
        double sum = 0;
        for (int j = 0; j < 5; j++)
        {
            scanf("%lf", &score[i][j]);
            sum += score[i][j];
            printf("%lf ", score[i][j]);
        }
        printf("%lf\n", sum);
    }

    return 0;
}