Changed sorting digits

compare appearance, then priority, then likelihood

Time: 16778ms