Sort powerset masks