<p>This paper investigates the formation of teams in a contest. A manager sorts four workers—who differ in their productivity—into two teams. Workers on each team join forces to produce team output, and one team wins a prize; for example, a bonus package. Two sorting patterns are possible: Positive sorting requires that each team consist of players of same caliber and negative sorting the opposite. We characterize the optimum. We further extend the model to allow the manager to set a prize schedule for the workers on each team upon a win, allocate productive resources between teams, and pick the level of competition of the contest.</p>