Amazon interview question

How to sort these items.