import java.util.LinkedList;

        // An implementation of a FIFO queue of cards.
class CardQueue {
    // Add a card to the queue.
    public void add(Card c){
        // Add it to the end.
        getQueue().add(c);
    }

    // Remove (and return) the next card from the queue.
    public Card next(){
        if(size() > 0){
            return (Card) getQueue().removeFirst();
        }
        else{
            return null;
        }
    }

    // Return (but don't remove) the next card from the queue.
    public Card peek(){
        if(size() > 0){
            return (Card) getQueue().getFirst();
        }
        else{
            return null;
        }
    }

    // How many cards in the queue?
    public int size(){
        return getQueue().size();
    }

    // Return a reference to the collection.
    private LinkedList getQueue(){
        return queue;
    }

    // The collection of objects.
    private LinkedList queue = new LinkedList();
}
