#include <stdio.h>
#include <string.h>
#include <assert.h>

#define NMAX 100100

#define FILEIN "medians.in"
#define FILEOUT "medians.out"

char used[2 * NMAX];
int A[2 * NMAX], B[NMAX], next[2 * NMAX], prev[2 * NMAX];
int N, nosol, vmin, vmax;

void read_input() {
    int i;

    freopen(FILEIN, "r", stdin);
    scanf("%d", &N);
    N = N / 2;

    for (i = 0; i <= N; i++)
        scanf("%d", &B[i]);
}

inline void updateVmin() {
    while (used[vmin])
        vmin++;
    used[vmin] = 1;
    prev[vmin] = vmin - 1;
    next[vmin] = next[vmin - 1];
    next[vmin - 1] = vmin;
    prev[next[vmin]] = vmin;
}

inline void updateVmax() {
    while (used[vmax])
        vmax--;
    used[vmax] = 1;
    next[vmax] = vmax + 1;
    prev[vmax] = prev[vmax + 1];
    next[prev[vmax]] = vmax;
    prev[vmax + 1] = vmax;
}

void compute() {
    int i;

    nosol = 0;
    A[1] = B[0];

    memset(used, 0, sizeof(used));
    memset(next, 0, sizeof(next));
    memset(prev, 0, sizeof(prev));

    used[A[1]] = 1;
    next[A[1]] = 2 * N + 2;
    prev[A[1]] = 0;

    vmin = 0;
    used[vmin] = 1;
    next[vmin] = A[1];
    prev[vmin] = vmin;

    vmax = 2 * N + 2;
    used[vmax] = 1;
    prev[vmax] = A[1];
    next[vmax] = vmax;

    for (i = 1; i <= N; i++) {
        if ((B[i] <= i) || (B[i] >= (2 * N + 2 - i))) {
            nosol = 1;
            break;
        }

        if (B[i] == B[i - 1]) { // easy
            updateVmax();
            A[2 * i] = vmax;
            updateVmin();
            A[2 * i + 1] = vmin;

            assert(B[i] < vmax);
            assert(B[i] > vmin);
        } else if (B[i] > B[i - 1]) {
            if (!used[B[i]]) {
                if (next[B[i - 1]] < B[i]) {
                    nosol = 1;
                    break;
                }

                used[B[i]] = 1;
                prev[next[B[i - 1]]] = B[i];
                next[B[i]] = next[B[i - 1]];
                prev[B[i]] = B[i - 1];
                next[B[i - 1]] = B[i];

                A[2 * i] = B[i];

                updateVmax();
                A[2 * i + 1] = vmax;

                assert(B[i] < vmax);
            } else {
                if (B[i] != next[B[i - 1]]) {
                    nosol = 1;
                    break;
                }

                updateVmax();
                A[2 * i] = vmax;

                updateVmax();
                A[2 * i + 1] = vmax;

                assert(B[i] < vmax);
            }
        } else { // B[i] < B[i - 1]
            if (!used[B[i]]) {
                if (prev[B[i - 1]] > B[i]) {
                    nosol = 1;
                    break;
                }

                used[B[i]] = 1;
                next[prev[B[i - 1]]] = B[i];
                prev[B[i]] = prev[B[i - 1]];
                next[B[i]] = B[i - 1];
                prev[B[i - 1]] = B[i];

                A[2 * i] = B[i];

                updateVmin();
                A[2 * i + 1] = vmin;

                assert(B[i] > vmin);
            } else {
                if (B[i] != prev[B[i - 1]]) {
                    nosol = 1;
                    break;
                }

                updateVmin();
                A[2 * i] = vmin;

                updateVmin();
                A[2 * i + 1] = vmin;

                assert(B[i] > vmin);
            }
        }
    }
}

void write_output() {
    int i;

    freopen(FILEOUT, "w", stdout);
    if (nosol) {
        printf("-1\n");
    } else {
        for (i = 1; i <= 2 * N + 1; i++) {
            printf("%d", A[i]);

            if (i <= 2 * N)
                printf(" ");
        }
        printf("\n");
    }
}

int main() {
    read_input();
    compute();
    write_output();
}
