IntermediateRating 1300
k-th Largest So Far
Numbers arrive one at a time. After each number arrives, print the k-th largest number seen so far, or -1 if fewer than k numbers have arrived.
Input
n and k, then n integers.
Output
n integers on one line.
Sample 1
Input
5 3 4 5 8 2 3
Output
-1 -1 4 4 4
Sample 2
Input
3 1 -1 -2 7
Output
-1 -1 7
Output appears here