import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] array=new int[n];
for(int i=0;i<n;i++)
{
array[i]=sc.nextInt();
}
int shan=sc.nextInt();
for(int i=0;i<n;i++)//要删就不输出😆 {
if(array[i]==shan)
{
continue;
}
System.out.print(array[i]+" ");
}
}
}