the three winners of each group plus the best second participated in the semifinals