iterate over a dictionary `d` in sorted order,it = iter(sorted(d.items()))