"at random"... "from order of lowest priority"... pick one
Come'on this is hacker news. I am sure most here have seen the mainframe based applications that entirely control every aspect of airline industry.
These things were coded by professionals over 30 years ago. Its not like these flights are being managed by some buggy wordpress plugin made by some offshore developer.