// editor3
#includ<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node* next;
};
int main(){
    int n;
    if(scanf("%d",&n) !=1){
        printf("Invalid input");
        return 0;
    }
    if(n<1){
        print("Empty");
        return 0;
    }
    struct Node *head = NULL, *tail = NULL;
    for(int = 0;i<n;i++){
        int value;
        if(scanf("%d",&value) !=1){
            printf("Invalid input");
            return 0;
        }
        struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
        newNode->data = value;
        newNode->next = NULL;
        if(head == NULL){
            head = tail = newNode;
        }
        else{
            tail->next = newNode;
            tail = newNode;
        }
    }
    struct Node *curr = head, *prev = NULL;
    while(curr !=NULL){
        if(curr->data % 2 !=0){
            head = curr->next;
            free(cur);
        }
        else{
            pre = curr;
            curr = curr->next;
        }
    }
    curr = head;
    while(curr !=NULL){
        printf("%d",curr=>data);
        if(curr-> !=NULL){
            printf(" ");
        }
        curr = curr->next;
    }
    
    return 0;
}    
        }
    }
        }
            
        }
        
    }
        }
        
            
        }
    }
    }
    }
}
}