Tuesday will mark the end of the line for four of the 12 Olympic teams while the other eight will be placed into the quarterfinal bracket where they will be two wins away from the podium. Like it or loathe it, the 12-team format means two of the three third-place finishers will advance and it also means any team could land on either side of the knockout bracket. There is also the matter of third place teams landing in different spots depending on which other third place team gets though. That’s plenty of possibilities for a small tournament.

What we know so far is that Brazil, Canada, and the United States are assured of the quarterfinals and every team is mathematically alive, even if some of the equations are scant and some of the necessary results would redefine the soccer upset.

Here is how it breaks down:

third place note: if the third place team from Group E gets through it will be drawn against the Group G winner; if the third place team from Group G gets through it will be drawn against the Group E winner; if the third place team from Group F gets through it will be drawn into the open slot based on the previous two possibilities

GROUP G

United States: The three-time defending champions are a draw against Colombia away from winning Group G. That would line them up against the third-place finisher in Group E or F. It would also put them in the same half as the Group E winner—almost certain to be Brazil. It would also mean being in the same half as Germany or Australia (barring a Zimbabwe result against Australia) though whether that would be a quarterfinal or potential semifinal depends on how the third-place scenario plays out. That might prove to be the more difficult half but the fact is every other team would be happier to avoid the U.S. than the U.S. would be to avoid them.

France: Assuming the U.S. handles Colombia it will take only a draw against New Zealand to secure second in the group (if the U.S. lose, France wins the group with a victory regardless of the score of either match) and a daunting quarterfinal date with the Group F winner which is down to Canada or Germany. If they get tripped up by the Kiwis—who will have Abby Erceg after her red card was overturned—it will still take a cataclysmic series of other results to send them home and third place from this group will face the Group E winner, again almost certainly Brazil.

New Zealand: A draw will assure the Football Ferns a place in the quarterfinals and even a narrow loss is likely to get it done. And of course if they upset France they are certainly through as runner-up and even in with a mathematical chance to win the group.

If they lose as most expect it will come down to either Zimbabwe getting a result against Australia or more realistically the final score in the China-Sweden match. Let’s assume Australia beat Zimbabwe and focus on New Zealand’s chances for advancing as the other third place finisher even without a result against the French. They are currently minus-1 in the goal difference column, the same as China and two better than Sweden. So they will need to keep it close enough to beat out the loser of that match on goal difference. The second tiebreaker is total goals and New Zealand current have 1 while China and Sweden both have 2.

The schedule does not work out in New Zealand’s favor either. If they lose then both China and Sweden are through with a draw and New Zealand are out (again assuming Australia beat Zimbabwe) and with New Zealand playing first, a loss to France could pave the way for China and Sweden to lull each other to sleep to prepare for the quarters.

Colombia: Colombia need to beat the United States…enough said?

Probably, but since we don’t assume anything, it is notable that even a shocking upset of the best team in the world could well leave Colombia at the bottom of the group on goal difference. But if they can somehow do it and manage to turn around their goal difference deficit against the France-New Zealand loser (if those two draw, Colombia are out) they would still need to hope that either: China and Sweden don’t draw and the score is lopsided enough to help on goal difference OR Australia does not beat Zimbabwe.

GROUP F

Canada: The conspiracy theorists began shouting the moment Kadeisha Buchanan took a yellow card against Zimbabwe that defied explanation. Is John Herdman sandbagging to try and finish second in the group for a quarterfinal against the Group E runner-up (likely the China-Sweden winner)? If Canada get a result against Germany they will win the group and face the Group G runner-up (likely France). Either way, by securing a top two spot it means they won’t see the Group G winner (likely the United States) until the gold medal match.

There could be another good reason to try and sandbag against Germany. The kooky setup of the bracket means the top two teams in the group are on a semifinal collision course. Either way, Herdman and the 2012 bronze medalists are undoubtedly thrilled to have a top two spot locked up before kicking off against the Germans.

Germany: Math says Germany is not booked to stay in the tournament beyond Tuesday, but would take a loss by at least eight goals to even start the conversation. Realistically they will win the group by beating Canada and finish second by losing or drawing. See above for what that means.

Australia: It hasn’t been the tournament the Aussies were hoping for to this point, but there should still be time to salvage things. And if they beat Zimbabwe they will be through almost certainly as the third place finisher which means they will get the Group E or G winner depending on which other third place team advances. Australia currently trail Germany by 7 on goal difference and can finish second by making that up in a win combined with a Germany loss to Canada. Anything other than a win sends Australia home.

Zimbabwe: No one expected Zimbabwe to do anything but finish last in this ultra-tough group and they will do just that barring a monumental upset of Australia. To advance they have to win and make up at least 6 in the goal difference column on the losers of China-Sweden and France-New Zealand.

GROUP E

Brazil: After passing the Sweden test with flying colors the hosts are in the catbird seat in Group E and will finish top with a draw against South Africa and maybe even if they get pipped since they’re dominating the group on goal difference. Winning the group will put them in the same half as the United States (assuming they win Group G), but the Brazilians will have a keen interest in what goes on with the third place teams. If New Zealand gets through from Group G they will face the Group E winner, but if a team from Brazil’s group gets through that means the Samba Queens will see Australia or Germany in the quarters.

China: The Chinese are a draw away from second place in Group E and watching Sweden through two matches that doesn’t sound as outlandish as it may have even a few weeks ago. Even if they lose China are in a good position on goal difference to get through so long as New Zealand and France don’t draw (assuming Australia win). If they finish second, the Group F runner-up awaits. If they finish third and advance, the Group G winner looms—likely the United States.

China can still mathematically win the group if South Africa can shock Brazil but the current margin in goal difference in minus-8. A South Africa upset could also send the Chinese to the bottom of the group should they fall to Sweden.

Sweden: Saturday night only felt like the end for Sweden when they were massacred by Brazil following a dull, 1-0 victory over South Africa. But if they beat China it will be on to the quarterfinals. A loss or draw though and the Swedes will be in trouble. If they draw and every third place team ends up on 4 points they are out. If they lose it will depend on goal difference but at minus-3 they are already behind France and New Zealand and they would have to beat out the loser of that match or hope Zimbabwe can get at least a draw against Australia. The good news is that Group E plays last on the day so Pia Sundhage’s side will have it all in front of them at kickoff.

South Africa: The team that held the United States to 1-0 in a friendly last month is in a world of trouble. For starters they need beat Brazil to have any chance. Beyond that they would have to make up goal difference on the loser of China-Sweden and the loser of France-New Zealand while hoping that neither of those end in draws. The only other path involved Australia not beating Zimbabwe.