def bst_create_node(name, phone):
    return {'name': name, 'phone': phone, 'left': None, 'right': None}

def bst_insert(root, name, phone):
    if root is None:
        return bst_create_node(name, phone)
    
    if name == root['name']:
        root['phone'] = phone
    elif name < root['name']:
        root['left'] = bst_insert(root['left'], name, phone)
    else:
        root['right'] = bst_insert(root['right'], name, phone)
    return root

def bst_find(root, name):
    if root is None:
        return None
    if root['name'] == name:
        return root['phone']
    if name < root['name']:
        return bst_find(root['left'], name)
    return bst_find(root['right'], name)

def _bst_min_value_node(node):
    current = node
    while current['left'] is not None:
        current = current['left']
    return current

def bst_delete(root, name):
    if root is None:
        return None

    if name < root['name']:
        root['left'] = bst_delete(root['left'], name)
    elif name > root['name']:
        root['right'] = bst_delete(root['right'], name)
    else:
    
        if root['left'] is None:
            return root['right']
        elif root['right'] is None:
            return root['left']
        
        temp = _bst_min_value_node(root['right'])
        root['name'] = temp['name']
        root['phone'] = temp['phone']
        root['right'] = bst_delete(root['right'], temp['name'])
        
    return root

def bst_list_all(root):
    def inorder(node, acc):
        if node:
            inorder(node['left'], acc)
            acc.append((node['name'], node['phone']))
            inorder(node['right'], acc)
        return acc
    
    return inorder(root, [])