def METHOD_NAME(tree, limit):
    old_tree = deepcopy(tree)
    for ip in old_tree.keys():
        if ip.prefixlen() >= limit:
            del tree[ip]
    for ip in tree.keys():
        METHOD_NAME(tree[ip], limit)