defaultdict is handy but double-copying it is bad, white original loop on normal dict, it's not that hard