Set intersection/difference/union code