You are writing a cup stacking module for a robot. The robot carries several sensors that read the radius and the color of a cup exactly. The trouble is a defect in the core routine that processes sensor input: when the color signal arrives after the radius signal, the routine passes on twice the radius, that is, the diameter.
For a red cup of radius 5, the module receives either red 5 or 10 red.
Given the list of messages sent by the core routine, where each message describes a different cup, sort the cups from the smallest to the largest.