You are given a sequence of numbers and a natural number $K$.
We look for the largest number in the sequence at positions divisible by $K$, where the positions of the numbers in the sequence are counted starting from zero. In other words, we look for the largest number at positions $0, K, 2K, 3K, \dots$. If there are multiple such largest numbers, we choose the first one. We remove the found number from the sequence, and the numbers that follow it naturally shift one position to the left, i.e., they change their positions to fill the resulting "gap".
We repeat the described step as long as there are numbers in the sequence. Write a program that performs this for us.
Input
The first line contains the natural numbers $N$ and $K$ ($2 \le K \le N \le 100\,000$).
The next line contains $N$ natural numbers with values in the interval $[1, N]$ that make up the given sequence, in order from the zeroth to the $(N-1)$-th number.
Output
Print $N$ natural numbers, where the $i$-th printed number is equal to the number removed in the $i$-th step.
Subtasks
| Subtask | Points | Additional Constraints |
|---|---|---|
| 1 | 7 | $N \le 1000$ |
| 2 | 25 | $K = 2$ |
| 3 | 23 | $K \le 10$ |
| 4 | 25 | $100 \le K \le N$ |
| 5 | 20 | No additional constraints |
Examples
Input 1
10 2 2 3 1 9 10 4 5 6 1 5
Output 1
10 6 4 5 2 9 3 5 1 1
Input 2
10 3 2 3 1 9 10 4 5 6 1 5
Output 2
9 10 4 5 6 2 5 3 1 1