#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define MAX 1001

// Helper function to check if the string is a valid floating-point number
int isFloat(const char *s) {
    int point_seen = 0, digit_seen = 0;
    if (*s == '-' || *s == '+') s++;
    if (!*s) return 0;
    while (*s) {
        if (*s == '.') {
            if (point_seen) return 0;
            point_seen = 1;
        } else if (!isdigit(*s)) {
            return 0;
        } else {
            digit_seen = 1;
        }
        s++;
    }
    return digit_seen;
}

int main() {
    int n, i;
    float arr[MAX];
    char buffer, *token;

    // Read the number of transactions
    if (!fgets(buffer, sizeof(buffer), stdin) || sscanf(buffer, "%d", &n) != 1 || n < 0 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }

    // Read the existing transaction amounts
    if (!fgets(buffer, sizeof(buffer), stdin)) {
        printf("Invalid input\n");
        return 0;
    }
    token = strtok(buffer, " \n\r");
    for (i = 0; i < n; i++) {
        if (!token || !isFloat(token)) {
            printf("Invalid input\n");
            return 0;
        }
        arr[i] = atof(token);
        token = strtok(NULL, " \n\r");
    }
    if (token) {
        printf("Invalid input\n");
        return 0;
    }

    // Read the new transaction amount
    if (!fgets(buffer, sizeof(buffer), stdin)) {
        printf("Invalid input\n");
        return 0;
    }
    token = strtok(buffer, " \n\r");
    if (!token || !isFloat(token)) {
        printf("Invalid input\n");
        return 0;
    }
    arr[n] = atof(token);

    // Print the updated list
    for (i = 0; i <= n; i++) {
        printf("%.2f", arr[i]);
        if (i < n) printf(" ");
    }
    printf("\n");
    return 0;
}