You’re implementing a patient management system for a hospital’s emergency room.
Each incoming patient has:
nameseverityLevel(1 = highest priority, 5 = lowest)arrivalNumber(auto-incremented, for tie-breaking)
Patients are treated in order of priority, and within the same priority, first-come-first-served.