Mexico has been one of the most impressive teams of the 2018 World Cup in Russia over the first two games, but El Tri could still potentially exit in the group stages on what should be a dramatic final day of play in Group F.

Germany, meanwhile, recovered from an opening-day loss to Mexico and saved their World Cup campaign with a last-second goal to beat Sweden on Saturday. Mexico, Sweden and Germany all have a chance to advance to the knockout rounds, and every position in the group will be up for grabs on June 27th.

The best-case scenario for Mexico

Mexico leads Group F with six points and a +2 goal difference, ahead of Germany and Sweden, both with three points and a goal difference of zero.

A win or draw against Sweden on June 27th would clinch the top spot in Group F for Mexico The winner of Group F will play the runner-up of Group E in the round of 16. Mexico fans should be rooting for Brazil to win or tie Serbia to clinch the top spot in Group E, which would likely leave Mexico with Switzerland (barring a lopsided Costa Rica victory).

The worst-case scenario for Mexico

A loss to Sweden and a Germany win over South Korea would leave three teams with six points in Group F, meaning the places will be determined by tiebreakers. Ties are settled first by goal difference in the group, then by total goals scored, and then by the number of points scored in matches between the tied teams. A loss to Sweden by any score would ensure that Sweden finishes ahead of Mexico on a tiebreaker. It’s possible Mexico could survive a one-goal loss to Sweden if Germany only manages a one-goal win over South Korea. Any wider margins in a potential Mexico loss or German win would see Sweden and Germany through to the knockout stages. A 1-0 loss to Sweden and a high-scoring Germany win would ensure elimination It’s possible that Mexico will want to avoid winning Group F. If Mexico were to win or draw with Sweden, Brazil could finish runner-up in Group E with a loss or draw to Serbia.

The best-case scenario for Germany

Despite the early struggles, Germany can still win Group F with a strong showing against South Korea.

A Mexico loss would allow Germany to win Group F. A draw between Mexico and Sweden would ensure Germany could, at best, finish second in the group. Germany and Sweden have the exact same goal difference and goal total with one game to play. If Germany can match Sweden’s goal difference and total, even if Sweden beats Mexico, Germany will win the group. If Germany finishes at the top of Group F, it will be rooting for Switzerland or Serbia to finish second in Group E.

The worst-case scenario for Germany

A second place finish in the group could likely mean a round of 16 match with Brazil, but it beats elimination. A loss against South Korea would eliminate Germany from the World Cup, as South Korea would vault Germany on a tiebreaker. A draw against South Korea would eliminate Germany if Sweden beats Mexico. A draw would be enough for Germany if Sweden draws with Mexico and scores an equal or lesser amount of goals as Germany in the game.