solve distinct