def prep(nums, k):
    dr = (len(nums) - k)
    stay = []
    for num in nums:
        while (dr and stay and (stay[(- 1)] < num)):
            stay.pop()
            dr -= 1
        stay.append(num)
    return stay[:k]
def prep(nums, k):
    dr = (len(nums) - k)
    stay = []
    for num in nums:
        while (dr and stay and (stay[(- 1)] < num)):
            stay.pop()
            dr -= 1
        stay.append(num)
    return stay[:k]