K-th Smallest Stream


You are given a stream of nn integers and an integer kk.

After each new integer arrives, report the kk-th smallest value among all numbers seen so far. If fewer than kk numbers have been seen, print -1 for that step.

Input

The first line contains two integers nn and kk.

The second line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n, where aia_i is the ii-th value in the stream.

Output

Print nn lines. On line ii, print:

  • the kk-th smallest value among a1,a2,…,aia_1, a_2, \dots, a_i, or
  • -1 if i<ki < k.

Constraints

  • 1≤k≤n≤2⋅1051 \le k \le n \le 2 \cdot 10^5
  • −109≤ai≤109-10^9 \le a_i \le 10^9

Example 1

Input 1
8 3
5 2 7 1 9 3 4 6
Output 1
-1
-1
7
5
5
3
3
3
Explanation

After the first 3 values (5, 2, 7), the 3rd smallest is 7. After 6 values (5, 2, 7, 1, 9, 3), sorted order is 1, 2, 3, 5, 7, 9, so the 3rd smallest is 3.

Example 2

Input 2
5 1
10 -4 8 8 0
Output 2
10
-4
-4
-4
-4

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.