#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

// Function to check if a string is a valid floating-point number
int is_valid_float(const char *s) {
    char *endptr;
    strtod(s, &endptr);
    return (*s != '\0' && *endptr == '\0');
}

int main() {
    int n;
    if (scanf("%d", &n) !=1) {
        printf("Invalid input\n");
        return 0;
    }

    double *arr = malloc((n + 1) * sizeof(double));
    if (!arr) {
        printf("Memory allocation failed\n");
        return 0;
    }

    for (int i = 0; i < n; i++) {
        char buf[64];
        if (scanf("%63s", buf) != 1 || !is_valid_float(buf)) {
            printf("Invalid input\n");
            free(arr);
            return 0;
        }
        arr[i] = atof(buf);
    }
char buf[128];
double val;
char *endptr;

if (!fgets(buf, sizeof(buf), stdin)) {
    printf("Invalid input\n");
    return 0;
}

val = strtod(buf, &endptr);

// Check: no conversion happened
if (endptr == buf) {
    printf("Invalid input\n");
    return 0;
}

// Skip whitespace after the number
while (*endptr == ' ' || *endptr == '\t' || *endptr == '\n') {
    endptr++;
}