D. Virtual Memory
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Virtual memory technology allows running programs that require more memory than is installed in the computer. In most modern architectures, virtual memory is organized using page addressing. Let's consider this technology in a simplified way.

The entire virtual memory is divided into pages — fixed-length memory areas. When a program accesses a certain address, the page number is calculated from the address, and it is checked whether the page is in physical memory or swapped out to disk.

If the required page is swapped out to disk, it needs to be moved to physical memory. However, since physical memory is occupied by other pages, some page from physical memory needs to be moved to disk first. To determine the number of the page to be swapped out, the LRU (least recently used) method is used: the page that has not been accessed for the longest time will be moved to disk. If there are several such pages, let this be the page with the lowest number among them.

Your task is to simulate the operation of the described system.

Input

The first line contains an integer $$$n$$$ — the size of virtual memory in pages ($$$1 \le n \le 2 \cdot 10^5$$$).

The second line contains an integer $$$m$$$ — the size of physical memory in pages ($$$1 \le m \le n$$$).

The third line contains an integer $$$k$$$ — the number of page accesses ($$$1 \le k \le 2 \cdot 10^5$$$).

The fourth line contains $$$k$$$ integers from $$$1$$$ to $$$n$$$ — the page numbers in the order of their access.

Before the program starts, the pages with numbers from 1 to $$$m$$$ are in physical memory, and the pages with numbers from $$$m+1$$$ to $$$n$$$ are on the disk.

Output

Output $$$m$$$ integers in ascending order — the page numbers that are in physical memory at the end of the program.

Example
Input
3
2
2
1 3
Output
1 3