import java.util.Collection;
import java.util.TreeMap;
class Closed
{
    TreeMap nodes;
    public Closed () {
        nodes = new TreeMap();
    }
    public String toString() {
        return nodes.toString();
    }

    public void put( Node n ) {
        nodes.put( n.location, n );
    }
    public Node get( Node n ) {
        return (Node) nodes.get( n.location );
    }
    public Node remove( Node n ){
        if( n == null ) return null;
        if( nodes.containsKey( n.location ) )
            return (Node) nodes.remove( n.location );
        return null;
    }
    public Collection values(){ 
        return nodes.values();
    }
}
