Amazon is entering a new business, Municipal Traffic Control. Please design a system for managing the traffic grid for a mid-sized US city. Assume custom internet-enabled devices will exist at each intersection to abstract the specifics of turning each light Green->Yellow->Red to change traffic flow direction and to ensure unsafe configurations such as all-directions-green do not occur.