1st The participians qualify with a certain number of wins and drop out with a certain number of defeats.
2nd The system does not know the notion of draw, a win must be reached (through one or more matches).
3rd Every team plays with opponents from their own category.
4th Same category = Teams with the same amount of win and defeats.
5th Any deviation from point 3 is only possible in special cases.
6th If, according to pure mathematics, not enough teams qualify, one or more or the drop-out teams can be invited to remain in the competition (using a rule that selects the best of them).