def delete_node(node):
    if (node.last and node.next):
        node.last.next = node.next
        node.next.last = node.last
    elif (node.next == None):
        node.last.next = None
    elif (node.last == None):
        node.next.last = None
    return node.next
def delete_node(node):
    if (node.last and node.next):
        node.last.next = node.next
        node.next.last = node.last
    elif (node.next == None):
        node.last.next = None
    elif (node.last == None):
        node.next.last = None
    return node.next