simpler formulation of All-different