def flatten(x):

    """
    Input:
    ([people],[hashtags]).
    Output:
    [(hashtag, (main_author_flag, {person})),...]

    """
    all_combinations = []
    people = x[0]
    hashtags = x[1]
    for person in people:
        for hashtag in hashtags:
            main_author_flag = 0 if "@" in person else 1
            all_combinations.append((hashtag, (main_author_flag, {person})))
    return all_combinations