How to shuffle the list based on model line

I am trying to rename the mark value based on model line. But the my result came on X and Y coordinates, I want to rename the element based on model line. Here is my script.

Sorry guys my results are came based on the element id. I wrongly mentioned as X and Y coordinates. Thanks in advance.

.