algorithms assignment to sort soccer teams