Sorts output