#include <stdio.h>

int main() {
    int num = 0;
    while (scanf("%d", &num) != EOF) 
    {
        int arr[50] = {0};
        int deleteNum = 0;
        for(int i = 0; i < num; i++)
        {
            scanf("%d",arr+i);
        }
        scanf("%d",&deleteNum);

        for (int i = 0; i<num;i++)
        {
            if (arr[i] != deleteNum)
            {
                printf("%d ", arr[i]);
            }
        }
    }
    return 0;
}