static Node BalanceRightDel(object key, object val, Node left, Node del)
{
if (del is Red)
return MakeRed(key, val, left, del.Blacken());
else if (left is Black)
return LeftBalance(key, val, left.Redden(), del);
else if (left is Red && left.Right is Black)
return MakeRed(left.Right.Key, left.Right.Val,
LeftBalance(left.Key, left.Val, left.Left.Redden(), left.Right.Left),
MakeBlack(key, val, left.Right.Right, del));
else
throw new InvalidOperationException("Invariant violation");
}