#include <stdio.h>

int main() {

    int n;//输入整数n
    scanf("%d", &n);

    int arr[n];//C99

    int i = 0;
    for (i=0; i<n; i++)//输入数组
    {
        scanf("%d", &arr[i]);
    }

    int del = 0;//要删除的值
    scanf("%d", &del);

    int j = 0;
    for (i=0; i<n; i++)//从arr代值到arr2
    {
        if (arr[i] != del)
        {
            arr[j++] = arr[i];
        }
    }
 
    for (i=0; i<j; i++)//输出arr2数组
    {
        printf("%d ", arr[i]);
    }

    return 0;
}