add rules to prefix-sorting.cpp