customization – 3rd attribute will appear if 1st attribute is selected in woocommerce

I have four attribute.
1st attribute has two variation.

If I select 1st variation in first attribute, the 3rd attribute will be appeared.
But if I select 2nd variation from 1st attribute, the 4th attribute will be appeard.

how to do it. Please help me.