use sorted(s) instead of list(s) for s as a set