USACO 2.1: Sorting a Three-Valued Sequence