A and B are at the ends of the upper and lower half of the first round. The first round is bye. The remaining 28 slots will be extracted. The top 8 losers draw lots to decide 5 or 6.
This method has certain contingency.
Divide into 8 groups, 4 people in each group, decide the top two in the group stage, and then eliminate them separately. According to the signing, A and B can't meet before the first final of 1 group, group 2, 1 group and group 2 respectively. The top 8 losers draw lots to decide 5 or 6.
Divided into 6 groups with 5 people in each group, the top 2 in the group qualified, the top 6 was decided by a round of cross, the top 3 was decided by two rounds, and the winner was decided by three people in turn.
Divided into 6 groups, 5 people in each group, the top three qualify, grab the number, and single elimination. The top 8 losers draw lots to decide 5 or 6. Personally, I think this is the fairest.
Divided into 4 groups, 7-8 people in each group, the top 4 in the group, single knockout. The top 8 losers draw lots to decide 5 or 6. This way is the least accidental, but the group stage takes up the table and takes more time.