def rightmost(root):
    """
    Returns the rightmost leaf in this tree.

    :param root: The root node of the tree.
    :type root: d20.ast.ChildMixin
    :rtype: d20.ast.ChildMixin
    """
    right = root
    while right.children:
        right = right.children[-1]
    return right