import sys input = sys.stdin.readline from collections import defaultdict def compress(l): l = list(set(l)) l.sort() idx = defaultdict(int) for i in range(len(l)): idx[l[i]] = i return idx, l class BIT: def __init__(self, n): self.n = n self.bit = [0]*(n+1) def add(self, i, x): i += 1 while i<=self.n: self.bit[i] += x i += i&(-i) def get(self, k): res = 0 N = 1 while N0: if res+i=K: i = bit.get(K) bit.add(i, -1) cnt -= 1 print(rev_idx[i]) else: print(-1)