#include <stdio.h>
#include <stdlib.h>

struct Node {
    int data;
    struct Node* next;
};


struct Node* createNode(int val) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = val;
    newNode->next = NULL;
    return newNode;
}

void verifyNode(struct Node* head, int target) {
    if(head == NULL) {
        printf("Node not found");
        return 0;
    }
    
    struct Node* curr = head;
    while(curr != NULL) {
        if(curr->data != target) {
            printf("%d ", curr->data);
        }
        curr = curr->next;
    }
}



int main() {
    
    int n, i;
    struct Node* head = NULL;
    struct Node* tail = NULL;
    
    if(scanf("%d", &n) != 1 || n < 1 || n > 100) {
        printf("Invalid input");
        return 0;
    }
    
    int arr[n];
    for(i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
        
        struct Node* node = createNode(arr[i]);
        
        if(head == NULL) {head = tail = node;}
        else {
            tail -> next = node;
            tail = node;
        }
    }
    
    verifyNode(head);
    return 0;
    
}