solve determine-the-order