import java.util.*;
public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        int n, m;
        try
        {
            if (!sc.hasNextInt()) throw new Exception();
            n = sc.nextInt();
            for (int i = 0; i < n; i++)
            {
                if (!sc.hasNextInt()) throw new Exception();
                list.add(sc.nextInt());
            }
            if (!sc.hasNextInt()) throw new Exception();
            m = sc.nextInt();
        }
        catch (Exception e)
        {
            System.out.println("Invalid Input");
            return;
        }
        if (!list.contains(m))
        {
            System.out.println("Value Not Found");
            return;
        }
        list.removeIf(x -> x == m);
        if (list.isEmpty()) {
            System.out.println("List is empty");
        }
        else
        {
            for (int num : list)
            {
                System.out.print(num + " ");
            }
        }
    }
}