title: Merging sets with common elements?
body: <p>I would like to merge sets with common elements. For example</p>
  
  <pre><code>input = set([frozenset([1,2,3,4]), frozenset([3,4,5,6,7,8]),  frozenset([1,1000]),
               frozenset([100, 200]), frozenset([100, 300, 400])])
  </code></pre>
  
  <p>Result: </p>
  
  <pre><code>set([frozenset([1,2,3,4,5,6,7,8, 1000]), frozenset([100,200,300,400])])
  </code></pre>
  
  <p>What would be an efficient way to achieve this?</p>