A ticket queue is a singly linked list, front to back. Remove the single node that is m-th from the END of the queue (m = 1 means the very last ticket, m = 2 means the second-to-last, and so on). It is guaranteed that 1 <= m <= n. Print the remaining tickets in order (print an empty line if the queue becomes empty).
Input format
Line 1: an integer n — the number of tickets.
Line 2: n space-separated integers — the ticket numbers, front to back.
Line 3: an integer m — the position from the end of the ticket to remove.
Output format
n - 1 space-separated integers: the remaining tickets in order (an empty line if none remain).
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ m ≤ n
- -1000000000 ≤ ticket number ≤ 1000000000