#include<stdio.h>
#include<stdlib.h>
struct Node {
    int data;
    struct Node *next;
};
int main() {
    int n, val, valid;
    if(scanf("%d", &n) != 1 || n < 1) {
        printf("Invalid input");
        return 0;
    }
    struct Node *head = NULL, *temp = NULL, *newNode;
    for (int i = 0; i < n; i++) {
        valid = scanf("%d", &val);
        if (valid != 1) { printf("Invalid input");
        return 0; }
        newNOde = malloc(sizeof(struct Node));
        newNode->data = val;
        newNode->next = NULL;
        if (!head) head = temp = newNode;
        else { temp->next = newNode; temp = newNode; }
    }
    struct Node *curr = head, *prev = NULL;
    while (curr) {
        if (curr->data % 2 != 0) {
            if (!prev) head = curr->next;
            else prev->next = curr->next;
            struct Node *del = curr;
            curr = curr->next;
            free(del);
        } else {
            prev = curr;
            curr = curr->next;
        }
    }
    if (!head) { printf("Empty"); return 0; }
    for (temp = head; temp; temp = temp->next)
         printf("%d ", temp->data);
    return 0;
}