You are given the integers 1 through n in order, forming the sequence (1,2,3,…,n). A number of requests follow. Each request names one integer in the sequence, and that integer moves to the head of the sequence. The order of the remaining elements stays the same. Report the order of the elements after all requests are processed in the given order.
Input
The input is a single test case in the following form.
n m
e1
.
.
.
em
The integer n is the length of the sequence (1≤n≤200000). The integer m is the number of requests (1≤m≤100000). The next m lines hold the requests e1,…,em, one per line. Each request ei (1≤i≤m) is an integer between 1 and n inclusive and designates the element to move. A request names the integer itself, not its position in the sequence.
Output
Print the sequence after all requests are processed. Print its elements one per line, in the order in which they appear in the sequence.
Hint
Take n=5 with the requests 4, 2, 5 in that order. The initial sequence is (1,2,3,4,5). The first request moves the integer 4 to the head, giving (4,1,2,3,5). The next request moves 2 to the head, giving (2,4,1,3,5). The last request moves 5, giving (5,2,4,1,3).