Try frozensets instead of tuples.