Any solution that any court comes to is out of bounds. Courts are not executive branch or legislative branch. No standing in court speak.
As in the Vietnam era war power cases, the Supreme Court is obliged to set the boundaries and terms but must step aside when it comes to who wins the battle.