in case 1, we should know that:

1. x->parent's color is always black

2. and because w is red, so w will have tow black children
case2 can partially solve the problem:

the key thing of the case is: bubble up the double color to the node's parent

1. change the w's color to red and make x single black
2. bubble up x -> x = x->parent
the case 3 and case 4, case 3 can change to case 4

1. case 3 is w's left child is red and  black right

2. case 4 don't case about w's left child, but right child should be red

the only thing you need to pay attention is: how to determine case 3:
        if(w->right->color== BLACK)
symetric pairs

each pair has 4 situation