masha_genres = {'рок', 'поп', 'джаз'}
petya_genres = {'поп', 'хип-хоп', 'электроника'}
common = masha_genres.intersection(petya_genres)
all_genres = masha_genres.union(petya_genres)
only_masha = masha_genres.difference(petya_genres)
print(f"Общие: {common}")
print(f"Все жанры: {all_genres}")
print(f"Только Маша: {only_masha}")