#include <stdio.h>

int main() {
    int i = 0;
    int j = 0;
    int n = 0;
    int del = 0;
    int arr[50] = {0};
    int arr2[50] = {0};
    scanf("%d",&n);
    for(i = 0;i<n;i++)
    {
        scanf("%d ",&arr[i]);
    }
    scanf("%d",&del);
    for(i = 0,j=0;i<n;i++)
    {
        if(del!=arr[i])
        {
            arr2[j] = arr[i];
            j++;
        }
    }
    for(i = 0;i<j;i++)
    printf("%d ",arr2[i]);
    return 0;
}