There are Switch1 and Switch2.
Wan1 of Port1 on Switch 1, Bridge1 of Port2-5 through DHCP1 on Wan1
Wan2 of Port6 on Switch 2, Bridge2 of Port7-10 through DHCP2 on Wan2
Masquerade on each separate way.
Set ports 3-4-5 of each switch to use their respective switch's port 2 as master port.There are Switch1 and Switch2.
Wan1 of Port1 on Switch 1, Bridge1 of Port2-5 through DHCP1 on Wan1
Wan2 of Port6 on Switch 2, Bridge2 of Port7-10 through DHCP2 on Wan2
Masquerade on each separate way.