- Time limit: 1.00 s
- Memory limit: 512 MB
You are given a list consisting of integers. Your task is to remove elements from the list at given positions, and report the removed elements.
Input
The first input line has an integer : the initial size of the list. During the process, the elements are numbered where is the current size of the list.
The second line has integers : the contents of the list.
The last line has integers : the positions of the elements to be removed.
Output
Print the elements in the order they are removed.
Constraints
Example
Input:
5 2 6 1 4 2 3 1 3 1 1
Output:
1 2 2 6 4
Explanation: The contents of the list are , , , , and .