POJ 1094 Sorting It All Out