balance (n, (Path L pv Red po):(Path R gv gc (Node uv Red ul ur)):path) =
    balance (Node gv Red (Node uv Black ul ur) (Node pv Black n po), path)
balance (n, (Path L pv Red po):(Path R gv gc (Node uv Red ul ur)):path) =
    balance (Node gv Red (Node uv Black ul ur) (Node pv Black n po), path)
balance (n, (Path L pv Red po):(Path R gv gc (Node uv Red ul ur)):path) =
    balance (Node gv Red (Node uv Black ul ur) (Node pv Black n po), path)