// editor1
#include <stdio.h>
#include <stdlib.h>

// Function to check if a string can be converted to a float
int isValidFloat(const char *str) {
    char *endptr;
    strtod(str, &endptr);
    return *endptr == '\0';
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 0 || n > 1000) {
        printf("Invalid input\n");
        return 1;
    }

    float *transactions = malloc((n + 1) * sizeof(float));
    if (!transactions) {
        printf("Memory allocation failed\n");
        return 1;
    }

    char input[1000];
    fgets(input, sizeof(input), stdin); // Consume newline left in input buffer
    fgets(input, sizeof(input), stdin);
    char *token = strtok(input, " ");
    int i = 0;
    while (token != NULL && i < n) {
        if (!isValidFloat(token)) {
            printf("Invalid input\n");
            free(transactions);
            return 1;
        }
        transactions[i++] = strtod(token, NULL);
        token = strtok(NULL, " ");
    }
    if (i != n) {
        printf("Invalid input\n");
        free(transactions);
        return 1;
    }

    float newAmount;
    if (scanf("%f", &newAmount) != 1) {
        printf("Invalid input\n");
        free(transactions);
        return 1;
    }
    transactions[n] = newAmount;

    for (i = 0; i <= n; i++) {
        printf("%.2f ", transactions[i]);
    }
    printf("\n");

    free(transactions);
    return 0;
}