def promoted_teams(df):
    """Returns a list with teams who are promoted to upper category.
    The first two teams from each are promoted.
    The best 4 third teams of the entire championship are promoted.

    Keyword arguments:
        df -- dataframe with the championship table"""

    promotion_list = []
    promotion_thirds = []

    # iterate over each row and check if its a promotion position.
    for i, row in df.iterrows():
        if row['POS'] < 3:
            promotion_list.append(row['Equipo'])
        if row['POS'] == 3:
            promotion_thirds.append(row['Equipo'])
    # add the third position teams promoted to the promotion list.
    promotion_list.extend(promotion_thirds[:4])

    return promotion_list