Use a defaultdict.