In a school football tournament, 8 teams participate, each of which plays equally well in football. Each game ends with the victory of one of the teams. A randomly chosen by a draw number determines the position of the teams in the table:
What is the probability that teams \(A\) and \(B\):
a) will meet in the semifinals;
b) will meet in the finals.