Reverse merging using priority