solve well_order