#include <stdio.h>

int main() {
    double a[8], b[8], sum = 0.0;
    for (int i = 0; i < 8; ++i){
        printf("num %d: ",i);
        scanf("%lf", &a[i]);
        sum += a[i];
        b[i] = sum;
    }
    for (int i = 0; i < 8; ++i)
       printf("%.3lf ", a[i]);
   printf("\n");
    for (int i = 0; i < 8; ++i)
       printf("%.3lf ", b[i]);
   printf("\n");
  return 0;    
}
