sort teams by id