greedy+sort