Sort input data pairs with frequency in monotonically ascending order.