Look at the API doc for the Queue class and find a method that removes the next item in the queue.
Make a loop that removes elements from the queue until it gets to the desired place in the queue.