def rotate_right_left(node):
    """Perform right, then left rotation around given node."""
    child = node.right
    new_root = child.left
    grand1 = new_root.left
    grand2 = new_root.right
    child.left = grand2
    node.right = grand1

    new_root.left = node
    new_root.right = child

    child.compute_height()
    node.compute_height()
    return new_root