If values are not unique in the dictionary, then you can map keys to that value. Here an example of how to do it using defaultdict
from collections import defaultdict
def reverse_dict(data: dict) -> dict:
rd = defaultdict(list)
for k, v in data.items():
rd[v].append(k)
return rd
if __name__ == "__main__":
from collections import Counter
data = "aaa bbb ccc ffffd aaa bbb ccc aaa"
c = Counter(data.split())
print(c)
# Counter({'aaa': 3, 'bbb': 2, 'ccc': 2, 'ffffd': 1})
rd = reverse_dict(c)
print(rd)
# defaultdict(<class 'list'>, {3: ['aaa'], 2: ['bbb', 'ccc'], 1: ['ffffd']})