#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node*next;
}Node;
Node*createNode(int data){
    Node*newNode=(Node*)malloc(sizeof(Node));
    if(!newNode){
        printf("Memory error\n");
        return NULL;
    }
    newNode->data=data;
    newNode->next=NULL;
    return newNode;
}
void insertNode(Node**head,int data){
    Node*newNode=createNode(data);
    if(*head == NULL){
        *head = newNode;
    }else{
        Node*temp=*head;
        while(temp->next){
            temp = temp->next;
        }
        temp->next=newNode;
    }
}
void purifyList(Node**head){
    Node*temp = *head;
    Node*prev=NULL;
    while(temp){
        if(temp->data%2!=0){
            if(prev == NULL){
                *head = temp->next;
                free(temp);
                temp=*head;
            }else{
                prev->next=temp->next;
                free(temp);
                temp=prev->next;
            }
        }else{
            prev = temp;
            temp = temp->next;
        }
    }
    
}
void printList(Node*head){
    if(head == NULL){
        printf("Empty\n");
        return;
        }
        while(head)
        printf("%d",head->data);
        head = head->next;
        if(head)printf(" ");
}
printf("/n");
}
int main(){
    int n;
    if(scanf("%d",&n)=1||n<1||n>1000){
        printf("Invalid input\n");
        return 0;
    }
    Node*head=NULL;
    for(int i=0;i<n;i++){
        int value;
        if(scanf("%d"&value)!=1||value<-100000||value>100000){
            printf("Invalid input");
            return 0;
        }
            insertNode(&head,vaue);
    }
    purifyList(&head);
    printList(head);
    Node*temp
    while(head){
        temp=head;
        head=head->next;
        free(temp);
    }
    return 0;
}