def add_data_for_name(name_data, year, rank, name):
    name_info = {year: rank}
    if (name in name_data):
        if (year in name_data[name]):
            exist_rank = int(name_data[name][year])
            if (int(rank) < exist_rank):
                name_data[name][year] = rank
        else:
            name_data[name][year] = rank
    else:
        name_data[name] = name_info
def add_data_for_name(name_data, year, rank, name):
    name_info = {year: rank}
    if (name in name_data):
        if (year in name_data[name]):
            exist_rank = int(name_data[name][year])
            if (int(rank) < exist_rank):
                name_data[name][year] = rank
        else:
            name_data[name][year] = rank
    else:
        name_data[name] = name_info