def removeNode(node, head, tail) :
    """ Given a node in the list, its head and tail pointers, we remove the node from the list and return the head and tail pointers of the list """
    if node is head :
        node = None
        return (None, None)
    if node is tail :
        tail = tail.prev
        tail.next = None
        node.prev = None
        return (head, tail)
    node.prev.next = node.next
    node.next.prev = node.prev
    node.next = None
    node.prev = None
    node = None
    return (head, tail)