An auction house is tracking bids for a rare painting. There is an integer
Each time a new bid arrives, the auctioneer wants to announce the
The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the rank to announce and the number of bids already placed.
The second line contains KaTeX can only parse string typed expression integers, the already-placed bid amounts.
The third line contains a single integer KaTeX can only parse string typed expression — the number of live bids that follow.
The fourth line contains KaTeX can only parse string typed expression integers, the live bid amounts, in the order they arrive.
Print KaTeX can only parse string typed expression integers, space-separated — the KaTeX can only parse string typed expression-th highest bid announced immediately after each live bid arrives, in order.
Input
3 4
4 5 8 2
5
3 5 10 9 4Output4 5 5 8 8ExplanationStarting bids: {4,5,8,2}. When 3 arrives, bids are {4,5,8,2,3}, and the 3rd highest is 4. When 5 arrives, the 3rd highest becomes 5. When 10 arrives, it's still 5. When 9 arrives, it becomes 8. When 4 arrives, it remains 8.
Example 2:
Input
1 1
5
3
2 8 1Output5 8 8ExplanationWith k=1, the announcement is simply the highest bid seen so far.