def compute_gender(last_gender: str,
                   top_gender_male: int,
                   top_gender_female: int,
                   top_gender_7_days: str):
    """Computes the gender type of a visitor using a majority voting rule."""
    def majority_voting(lst):
        return max(set(lst), key=lst.count)

    if top_gender_male > top_gender_female:
        top_gender = 'M'
    else:
        top_gender = 'F'

    return majority_voting([last_gender, top_gender, top_gender_7_days])