A print queue is a singly linked list of n jobs. A job is cancelled by its distance from the end of the queue: k = 1 cancels the very last job, k = 2 the second-to-last, and so on. Remove the k-th job counting from the tail and report the queue that remains.
Input format
Line 1: an integer n, the number of nodes.
Line 2: n space-separated integers, the node values from head to tail.
Line 3: an integer k, the 1-based position from the end of the node to remove.
Output format
A single line with the remaining values, space-separated, from head to tail. If removing the node leaves the list empty, print EMPTY.
Constraints
- 1 <= n <= 100000
- 1 <= k <= n
- -1000000000 <= each value <= 1000000000
- Values may repeat; exactly one node (the k-th from the end) is removed.