How to format path of many to many object relation

I want to format path of a many to many object relation which have to many to one relation.